[PATCH] D56966: [clang-tidy] misc-non-private-member-variables-in-classes: ignore implicit methods

Bruno Ricci via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 20 06:05:31 PST 2019


riccibruno added inline comments.


================
Comment at: docs/clang-tidy/checks/misc-non-private-member-variables-in-classes.rst:9
 
-Finds classes that contain non-static data members in addition to non-static
-member functions and diagnose all data members declared with a non-``public``
-access specifier. The data members should be declared as ``private`` and
-accessed through member functions instead of exposed to derived classes or
-class consumers.
+Finds classes that contain non-static data members in addition to user-provided
+non-static member functions and diagnose all data members declared with a
----------------
lebedev.ri wrote:
> riccibruno wrote:
> > Just a small remark: What do you mean exactly by "user-provided" ?
> > 
> > The term "user-provided" is defined in 11.4.2 [dcl.fct.def.default]/5 as
> > 
> > > A function is user-provided if it is user-declared and not explicitly
> > > defaulted or deleted on its first declaration.
> Yeah, i'm not sure what is the right word to use here,
> suggestions welcomed.
> The previous wording was confusing too, since non-implicit can be read as [[ https://en.cppreference.com/w/cpp/language/explicit | explicit specifier ]] which is not what is meant.
A suggestion without looking at the rest of the patch:

It depends on whether you want to include explicitly defaulted/deleted
member functions. If yes, then use "user-declared" and otherwise
use "user-provided" ?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56966/new/

https://reviews.llvm.org/D56966





More information about the cfe-commits mailing list