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

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 31 06:54:42 PDT 2017


xazax.hun added inline comments.


================
Comment at: clang-tidy/misc/CopyConstructorInitCheck.cpp:22
+AST_MATCHER(CXXCtorInitializer, ctorInit) {
+  return cxxCtorInitializer(
+             isBaseInitializer(),
----------------
Wouldn't something like:

```
static auto ctorInit = cxxCtorInitializer(....);
```
work? 

I would prefer that rather than a new AST_MATCHER.

And later you could use `ctorInit` without parens.


================
Comment at: test/clang-tidy/misc-copy-constructor-init.cpp:21
+    // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: calling an inherited constructor other than the copy constructor [misc-copy-constructor-init]
+	// CHECK-FIXES: : Copyable2(other)
+};
----------------
These check-fixes lines should contain the whole line after the fixit is applied. 


https://reviews.llvm.org/D33722





More information about the cfe-commits mailing list