[PATCH] D13787: [clang-tidy] add check cppcoreguidelines-pro-type-vararg-use

Matthias Gehre via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 16 12:21:21 PDT 2015


mgehre added inline comments.

================
Comment at: clang-tidy/cppcoreguidelines/ProTypeVarargUseCheck.cpp:20
@@ +19,3 @@
+void ProTypeVarargUseCheck::registerMatchers(MatchFinder *Finder) {
+  Finder->addMatcher(callExpr(callee(functionDecl(isVariadic()))).bind("expr"), this);
+}
----------------
sbenza wrote:
> The guideline says that we should also issue a diagnostics for uses of va_list/va_start/va_arg.
This is handled by http://reviews.llvm.org/D13785

================
Comment at: test/clang-tidy/cppcoreguidelines-pro-type-vararg-use.cpp:14
@@ +13,3 @@
+
+void check() {
+  f_vararg(1, 7, 9);
----------------
sbenza wrote:
> how does this handle SFINAE style ... uses?
> The guideline mentions this case as "useful" so we should try to avoid warning on it.
I saw the note in the guidelines, but frankly I don't quite get the use case.
Do you have an example or reference for me?


http://reviews.llvm.org/D13787





More information about the cfe-commits mailing list