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