clang-tools 22.0.0git
|
This check warns on variables which could be declared const but are not. More...
#include <ConstCorrectnessCheck.h>
Public Member Functions | |
ConstCorrectnessCheck (StringRef Name, ClangTidyContext *Context) | |
bool | isLanguageVersionSupported (const LangOptions &LangOpts) const override |
void | storeOptions (ClangTidyOptions::OptionMap &Opts) override |
void | registerMatchers (ast_matchers::MatchFinder *Finder) override |
void | check (const ast_matchers::MatchFinder::MatchResult &Result) override |
This check warns on variables which could be declared const but are not.
For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/misc/const-correctness.html
Definition at line 22 of file ConstCorrectnessCheck.h.
clang::tidy::misc::ConstCorrectnessCheck::ConstCorrectnessCheck | ( | StringRef | Name, |
ClangTidyContext * | Context ) |
Definition at line 38 of file ConstCorrectnessCheck.cpp.
|
override |
If the variable was declared in a template it might be analyzed multiple times. Only one of those instantiations shall emit a warning. NOTE: This shall only deduplicate warnings for variables that are not instantiation dependent. Variables like 'int x = 42;' in a template that can become const emit multiple warnings otherwise.
Definition at line 143 of file ConstCorrectnessCheck.cpp.
References clang::tidy::misc::Pointer, clang::tidy::misc::Reference, and clang::tidy::misc::Value.
|
inlineoverride |
Definition at line 27 of file ConstCorrectnessCheck.h.
|
override |
Definition at line 83 of file ConstCorrectnessCheck.cpp.
References clang::tidy::matchers::matchesAnyListedName().
|
override |
Definition at line 65 of file ConstCorrectnessCheck.cpp.
References clang::tidy::utils::options::serializeStringList().