[PATCH] D33722: [clang-tidy] Add checker for undelegated copy of base classes

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 16 05:57:47 PST 2017


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

Aside from two minor nits, the check LGTM. Whether we put it in misc or bugprone can be answered by @alexfh or by your best judgement.



================
Comment at: clang-tidy/misc/CopyConstructorInitCheck.cpp:61
+    ShouldNotDoFixit = ShouldNotDoFixit || CtorInitIsWritten;
+    const auto *BaseClass = BaseType->getAsCXXRecordDecl()->getDefinition();
+    if (BaseClass->field_empty() &&
----------------
Please don't use `auto` here.


================
Comment at: docs/clang-tidy/checks/misc-copy-constructor-init.rst:29
+
+The check suggests a fix-it in every scenario including multiple 
+missing initializers and constructors with template argument.
----------------
This comment is no longer accurate (there are some times we don't supply a fix-it).


https://reviews.llvm.org/D33722





More information about the cfe-commits mailing list