1 .. title:: clang-tidy - misc-non-private-member-variables-in-classes
3 misc-non-private-member-variables-in-classes
4 ============================================
6 `cppcoreguidelines-non-private-member-variables-in-classes` redirects here
7 as an alias for this check.
9 Finds classes that contain non-static data members in addition to user-declared
10 non-static member functions and diagnose all data members declared with a
11 non-``public`` access specifier. The data members should be declared as
12 ``private`` and accessed through member functions instead of exposed to derived
13 classes or class consumers.
18 .. option:: IgnoreClassesWithAllMemberVariablesBeingPublic
20 Allows to completely ignore classes if **all** the member variables in that
21 class a declared with a ``public`` access specifier.
23 .. option:: IgnorePublicMemberVariables
25 Allows to ignore (not diagnose) **all** the member variables declared with
26 a ``public`` access specifier.