Before:
#define IF(a, b, c) if (a&&(b == c))
After:
#define IF(a, b, c) if (a && (b == c))
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188256
91177308-0d34-0410-b5e6-
96231b3b80d8
}
}
- if (Left->Previous && Left->Previous->is(tok::kw_static_assert))
+ if (Left->Previous && Left->Previous->isOneOf(tok::kw_static_assert,
+ tok::kw_if, tok::kw_while))
Contexts.back().IsExpression = true;
if (StartsObjCMethodExpr) {
verifyFormat("template <bool B, bool C> class A {\n"
" static_assert(B && C, \"Something is wrong\");\n"
"};");
+ verifyGoogleFormat("#define IF(a, b, c) if (a && (b == c))");
+ verifyGoogleFormat("#define WHILE(a, b, c) while (a && (b == c))");
}
TEST_F(FormatTest, FormatsBinaryOperatorsPrecedingEquals) {