}
}
- if (Left->Previous && Left->Previous->isOneOf(tok::kw_static_assert,
- tok::kw_if, tok::kw_while)) {
+ if (Left->Previous &&
+ (Left->Previous->isOneOf(tok::kw_static_assert, tok::kw_if,
+ tok::kw_while, tok::l_paren, tok::comma) ||
+ Left->Previous->Type == TT_BinaryOperator)) {
// static_assert, if and while usually contain expressions.
Contexts.back().IsExpression = true;
} else if (Left->Previous && Left->Previous->is(tok::r_square) &&
FormatStyle PointerLeft = getLLVMStyle();
PointerLeft.PointerBindsToType = true;
verifyFormat("delete *x;", PointerLeft);
+ verifyFormat("STATIC_ASSERT((a & b) == 0);");
+ verifyFormat("STATIC_ASSERT(0 == (a & b));");
}
TEST_F(FormatTest, UnderstandsAttributes) {