alexfh added inline comments.

================
Comment at: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp:206
@@ +205,3 @@
+  // Do not propose fixes in macros since we cannot place them correctly.
+  if (Ctor->getLocStart().isMacroID())
+    return;
----------------
IIUC what this is doing, the offset should be `0` instead of 
`Field->getName().size()`. I've tried 
`Lexer::getLocForEndOfToken(Field->getSourceRange().getEnd(), 0, 
*Result.SourceManager, Result.Context->getLangOpts())` and it seems to work 
fine on your tests.

================
Comment at: test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp:96
@@ +95,3 @@
+UNINITIALIZED_FIELD_IN_MACRO_BODY(F);
+// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: constructor does not initialize 
these built-in/pointer fields: F
+UNINITIALIZED_FIELD_IN_MACRO_BODY(G);
----------------
We also need to check that the macro definition stays the same. The lack of 
CHECK-FIXES doesn't ensure the fix wasn't applied (probably, it should, but 
that's another story).


http://reviews.llvm.org/D16517



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to