[PATCH] D69145: Give readability-redundant-member-init an option IgnoreBaseInCopyConstructors to avoid breaking code with gcc -Werror=extra

Matthias Gehre via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 19 04:17:21 PDT 2019


mgehre added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/readability/RedundantMemberInitCheck.cpp:55
   const auto *Construct = Result.Nodes.getNodeAs<CXXConstructExpr>("construct");
+  const auto* ConstructorDecl = Result.Nodes.getNodeAs<CXXConstructorDecl>( "constructor" );
+
----------------
Extra space around string literal - did you run clang-format on your changes?


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/readability-redundant-member-init.rst:30
+    within copy constructors. Some compilers issue warnings requiring copy
+    constructors to explicitly initialize their base classes.
+
----------------
I'd might be helpful to mention `gcc` and `-Wextra` here so users can easily identify whether this case applies to them.


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D69145





More information about the cfe-commits mailing list