summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang-tools-extra/clang-tidy/bugprone/MacroParenthesesCheck.cpp2
-rw-r--r--clang-tools-extra/test/clang-tidy/checkers/bugprone-macro-parentheses.cpp1
2 files changed, 2 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/bugprone/MacroParenthesesCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/MacroParenthesesCheck.cpp
index 7ca5c1e3454..8d4366b51a3 100644
--- a/clang-tools-extra/clang-tidy/bugprone/MacroParenthesesCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/MacroParenthesesCheck.cpp
@@ -54,7 +54,7 @@ static bool isSurroundedRight(const Token &T) {
/// Is given TokenKind a keyword?
static bool isKeyword(const Token &T) {
// FIXME: better matching of keywords to avoid false positives.
- return T.isOneOf(tok::kw_case, tok::kw_const, tok::kw_struct);
+ return T.isOneOf(tok::kw_if, tok::kw_case, tok::kw_const, tok::kw_struct);
}
/// Warning is written when one of these operators are not within parentheses.
diff --git a/clang-tools-extra/test/clang-tidy/checkers/bugprone-macro-parentheses.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone-macro-parentheses.cpp
index 2cc45e83b20..8d128352e78 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/bugprone-macro-parentheses.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone-macro-parentheses.cpp
@@ -43,6 +43,7 @@
#define GOOD30(args...) std::cout << args;
#define GOOD31(X) A*X=2
#define GOOD32(X) std::vector<X>
+#define GOOD33(x) if (!a__##x) a_##x = &f(#x)
// These are allowed for now..
#define MAYBE1 *12.34
OpenPOWER on IntegriCloud