[clang-tools-extra] r270470 - Commiting for http://reviews.llvm.org/D20365
Mads Ravn via cfe-commits
cfe-commits at lists.llvm.org
Mon May 23 11:06:30 PDT 2016
Author: madsravn
Date: Mon May 23 13:06:29 2016
New Revision: 270470
URL: http://llvm.org/viewvc/llvm-project?rev=270470&view=rev
Log:
Commiting for http://reviews.llvm.org/D20365
Modified:
clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp
clang-tools-extra/trunk/test/clang-tidy/misc-macro-parentheses.cpp
Modified: clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp?rev=270470&r1=270469&r2=270470&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp Mon May 23 13:06:29 2016
@@ -188,6 +188,10 @@ void MacroParenthesesPPCallbacks::argume
if (Prev.is(tok::kw_namespace))
continue;
+ // Variadic templates
+ if (MI->isVariadic())
+ continue;
+
Check->diag(Tok.getLocation(), "macro argument should be enclosed in "
"parentheses")
<< FixItHint::CreateInsertion(Tok.getLocation(), "(")
Modified: clang-tools-extra/trunk/test/clang-tidy/misc-macro-parentheses.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/misc-macro-parentheses.cpp?rev=270470&r1=270469&r2=270470&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/misc-macro-parentheses.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/misc-macro-parentheses.cpp Mon May 23 13:06:29 2016
@@ -37,6 +37,8 @@
#define GOOD26(x) (a->*x)
#define GOOD27(x) (a.*x)
#define GOOD28(x) namespace x {int b;}
+#define GOOD29(...) std::cout << __VA_ARGS__;
+#define GOOD30(args...) std::cout << args;
// These are allowed for now..
#define MAYBE1 *12.34
More information about the cfe-commits
mailing list