sbenza added inline comments.

================
Comment at: clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp:26
@@ +25,3 @@
+  Finder->addMatcher(
+      varDecl(hasType(pointsTo(cxxRecordDecl(hasName("__va_list_tag")))))
+          .bind("va_list"),
----------------
Is there a way to look for the standard type (and not the implementation 
defined __xxx type name)?

================
Comment at: test/clang-tidy/cppcoreguidelines-pro-type-vararg.cpp:38
@@ +37,3 @@
+  int i = va_arg(ap, int);
+  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: do not use va_start/va_arg to 
define c-style vararg functions; use variadic templates instead
+  va_end(ap); // Don't warn, va_end is anyway useless without va_start
----------------
isn't va_arg as useless as va_copy (without va_start)?

Actually, given that va_arg is the only one we can look for without using the 
private __va_xxx name, maybe we should only warn on that one.


http://reviews.llvm.org/D13787



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

Reply via email to