clang-tools 22.0.0git
|
This checker finds classes that not only contain the data (non-static member variables), but also have logic (non-static member functions), and diagnoses all member variables that have any other scope other than private. More...
#include <NonPrivateMemberVariablesInClassesCheck.h>
Public Member Functions | |
NonPrivateMemberVariablesInClassesCheck (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 checker finds classes that not only contain the data (non-static member variables), but also have logic (non-static member functions), and diagnoses all member variables that have any other scope other than private.
They should be made private, and manipulated exclusively via the member functions.
Optionally, classes with all member variables being public could be ignored and optionally all public member variables could be ignored.
For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/misc/non-private-member-variables-in-classes.html
Definition at line 27 of file NonPrivateMemberVariablesInClassesCheck.h.
clang::tidy::misc::NonPrivateMemberVariablesInClassesCheck::NonPrivateMemberVariablesInClassesCheck | ( | StringRef | Name, |
ClangTidyContext * | Context ) |
Definition at line 40 of file NonPrivateMemberVariablesInClassesCheck.cpp.
|
override |
Definition at line 84 of file NonPrivateMemberVariablesInClassesCheck.cpp.
|
inlineoverride |
Definition at line 31 of file NonPrivateMemberVariablesInClassesCheck.h.
|
override |
Definition at line 57 of file NonPrivateMemberVariablesInClassesCheck.cpp.
|
override |
Definition at line 49 of file NonPrivateMemberVariablesInClassesCheck.cpp.