================
Comment at: clang-tidy/misc/CMakeLists.txt:9
@@ -8,2 +8,3 @@
   SwappedArgumentsCheck.cpp
+  UndelegatedConstructor.cpp
   UnusedRAII.cpp
----------------
I'd add "Check" to the class name for consistency.

================
Comment at: clang-tidy/misc/UndelegatedConstructor.cpp:63
@@ +62,3 @@
+                  .bind("construct"))),
+          unless(hasAncestor(decl(
+              anyOf(recordDecl(ast_matchers::isTemplateInstantiation()),
----------------
Please add a test with template instantiations. It's useful to know that the 
matcher doesn't crash on them ;)

================
Comment at: clang-tidy/misc/UndelegatedConstructor.cpp:72
@@ +71,3 @@
+  diag(E->getLocStart(),
+       "calling a different constructor in a constructor does not chain them");
+}
----------------
The message could be a bit clearer of what actually happens here. Maybe 
something along the lines of: "Did you intend to call a delegated constructor? 
A temporary object is created here instead"

================
Comment at: test/clang-tidy/misc-undelegated-constructor.cpp:1
@@ +1,2 @@
+// RUN: clang-tidy -checks='-*,misc-undelegated-constructor' %s -- -std=c++11 
2>&1 | FileCheck %s
+
----------------
Please add -implicit-check-not='{{warning:|error:}}'.

http://reviews.llvm.org/D4667



_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to