// static_assert, if and while usually contain expressions.
Contexts.back().IsExpression = true;
} else if (Line.InPPDirective &&
- (!Left->Previous || Left->Previous->isNot(tok::identifier))) {
+ (!Left->Previous ||
+ (Left->Previous->isNot(tok::identifier) &&
+ Left->Previous->Type != TT_OverloadedOperator))) {
Contexts.back().IsExpression = true;
} else if (Left->Previous && Left->Previous->is(tok::r_square) &&
Left->Previous->MatchingParen &&
// FIXME: Is there a way to make this work?
// verifyIndependentOfContext("MACRO(A *a);");
+ EXPECT_EQ("#define OP(x) \\\n"
+ " ostream &operator<<(ostream &s, const A &a) { \\\n"
+ " return s << a.DebugString(); \\\n"
+ " }",
+ format("#define OP(x) \\\n"
+ " ostream &operator<<(ostream &s, const A &a) { \\\n"
+ " return s << a.DebugString(); \\\n"
+ " }",
+ getLLVMStyleWithColumns(50)));
+
// FIXME: We cannot handle this case yet; we might be able to figure out that
// foo<x> d > v; doesn't make sense.
verifyFormat("foo<a < b && c> d > v;");