[PATCH] Fix ExplicitConstructorCheck to warn only on in-class declarations.

Daniel Jasper djasper at google.com
Thu Feb 13 00:47:15 PST 2014



================
Comment at: clang-tidy/google/GoogleTidyModule.cpp:35
@@ -34,1 +34,3 @@
       Result.Nodes.getNodeAs<CXXConstructorDecl>("construct");
+  if (Ctor != Ctor->getCanonicalDecl())
+    return;
----------------
Using getCanonicalDecl() makes quite a few implicit assumptions. Why not just use "if (!Ctor->isOutOfLine())"?


http://llvm-reviews.chandlerc.com/D2756



More information about the cfe-commits mailing list