clang-tools 22.0.0git
clang::tidy::bugprone::SuspiciousIncludeCheck Class Reference

Warns on inclusion of files whose names suggest that they're implementation files, instead of headers. More...

#include <SuspiciousIncludeCheck.h>

Inheritance diagram for clang::tidy::bugprone::SuspiciousIncludeCheck:
[legend]

Public Member Functions

 SuspiciousIncludeCheck (StringRef Name, ClangTidyContext *Context)
void registerPPCallbacks (const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) override

Public Attributes

FileExtensionsSet HeaderFileExtensions
FileExtensionsSet ImplementationFileExtensions

Detailed Description

Warns on inclusion of files whose names suggest that they're implementation files, instead of headers.

E.g:

#include "foo.cpp"  // warning
#include "bar.c"    // warning
#include "baz.h"    // no diagnostic

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/suspicious-include.html

Definition at line 26 of file SuspiciousIncludeCheck.h.

Constructor & Destructor Documentation

◆ SuspiciousIncludeCheck()

clang::tidy::bugprone::SuspiciousIncludeCheck::SuspiciousIncludeCheck ( StringRef Name,
ClangTidyContext * Context )

Member Function Documentation

◆ registerPPCallbacks()

void clang::tidy::bugprone::SuspiciousIncludeCheck::registerPPCallbacks ( const SourceManager & SM,
Preprocessor * PP,
Preprocessor * ModuleExpanderPP )
override

Definition at line 46 of file SuspiciousIncludeCheck.cpp.

References clang::tidy::bugprone::PP.

Member Data Documentation

◆ HeaderFileExtensions

FileExtensionsSet clang::tidy::bugprone::SuspiciousIncludeCheck::HeaderFileExtensions

Definition at line 32 of file SuspiciousIncludeCheck.h.

Referenced by SuspiciousIncludeCheck().

◆ ImplementationFileExtensions

FileExtensionsSet clang::tidy::bugprone::SuspiciousIncludeCheck::ImplementationFileExtensions

Definition at line 33 of file SuspiciousIncludeCheck.h.

Referenced by SuspiciousIncludeCheck().


The documentation for this class was generated from the following files: