Skip to content

Fix "missing header guard"-warning for a standalone header

Bernd Buschinski requested to merge buschinski/kdevelop:headerguard-fix into 5.5

Fix "missing header guard"-warning for a standalone header being always present. Meaning a header that is not included in any other source file in your project. Such a header would always have the "missing include guard" warning, regardless if guards are present or not.

This is caused by clang_isFileMultipleIncludeGuarded returning 0 (not guarded) for standalone header. I added a clang_Location_isFromMainFile check, which checks if the "source location" is in the main file, which (if we only have a header) is true.

Edited by Bernd Buschinski

Merge request reports