// initializers.
if (Line.IsMultiVariableDeclStmt &&
(Left.NestingLevel == Line.First->NestingLevel ||
- startsWithInitStatement(Line)))
+ ((Left.NestingLevel == Line.First->NestingLevel + 1) &&
+ startsWithInitStatement(Line))))
return false;
return Left.Previous && !Left.Previous->isOneOf(
tok::l_paren, tok::coloncolon, tok::l_square);
verifyFormat(
"/*comment*/ switch (int *p, *q; p != q) {\n default:\n break;\n}",
Style);
+
+ verifyFormat("if ([](int* p, int* q) {}()) {\n}", Style);
+ verifyFormat("for ([](int* p, int* q) {}();;) {\n}", Style);
+ verifyFormat("for (; [](int* p, int* q) {}();) {\n}", Style);
+ verifyFormat("for (;; [](int* p, int* q) {}()) {\n}", Style);
+ verifyFormat("switch ([](int* p, int* q) {}()) {\n default:\n break;\n}",
+ Style);
}
TEST_F(FormatTest, ConditionalExpressionsInBrackets) {