clang-tools 22.0.0git
|
Checks for usages of identifiers reserved for use by the implementation. More...
#include <ReservedIdentifierCheck.h>
Public Member Functions | |
ReservedIdentifierCheck (StringRef Name, ClangTidyContext *Context) | |
void | storeOptions (ClangTidyOptions::OptionMap &Opts) override |
Public Member Functions inherited from clang::tidy::RenamerClangTidyCheck | |
RenamerClangTidyCheck (StringRef CheckName, ClangTidyContext *Context) | |
~RenamerClangTidyCheck () | |
void | registerMatchers (ast_matchers::MatchFinder *Finder) final |
Derived classes should not implement any matching logic themselves; this class will do the matching and call the derived class' getDeclFailureInfo() and getMacroFailureInfo() for determining whether a given identifier passes or fails the check. | |
void | check (const ast_matchers::MatchFinder::MatchResult &Result) final |
void | registerPPCallbacks (const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) final |
void | onEndOfTranslationUnit () final |
void | storeOptions (ClangTidyOptions::OptionMap &Opts) override |
Derived classes that override this function should call this method from the overridden method. | |
void | checkMacro (const Token &MacroNameTok, const MacroInfo *MI, const SourceManager &SourceMgr) |
Check Macros for style violations. | |
void | expandMacro (const Token &MacroNameTok, const MacroInfo *MI, const SourceManager &SourceMgr) |
Add a usage of a macro if it already has a violation. | |
void | addUsage (const NamedDecl *Decl, SourceRange Range, const SourceManager &SourceMgr) |
Additional Inherited Members | |
Public Types inherited from clang::tidy::RenamerClangTidyCheck | |
enum class | ShouldFixStatus { ShouldFix , ConflictsWithKeyword , ConflictsWithMacroDefinition , FixInvalidIdentifier , IgnoreFailureThreshold , InsideMacro } |
This enum will be used in select of the diagnostic message. More... | |
using | NamingCheckId = std::pair<SourceLocation, StringRef> |
using | NamingCheckFailureMap |
Checks for usages of identifiers reserved for use by the implementation.
The C and C++ standards both reserve the following names for such use:
The C standard additionally reserves names beginning with a double underscore, while the C++ standard strengthens this to reserve names with a double underscore occurring anywhere.
For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html
Definition at line 31 of file ReservedIdentifierCheck.h.
clang::tidy::bugprone::ReservedIdentifierCheck::ReservedIdentifierCheck | ( | StringRef | Name, |
ClangTidyContext * | Context ) |
Definition at line 56 of file ReservedIdentifierCheck.cpp.
References clang::tidy::RenamerClangTidyCheck::RenamerClangTidyCheck().
|
override |
Definition at line 64 of file ReservedIdentifierCheck.cpp.
References clang::tidy::utils::options::serializeStringList(), and clang::tidy::RenamerClangTidyCheck::storeOptions().