Differential Revision: https://reviews.llvm.org/D120503
assert(Token->BraceCount == -1);
Brace = '{';
} else {
- Brace = std::string(Token->BraceCount, '}');
+ Brace = '\n' + std::string(Token->BraceCount, '}');
}
Token->BraceCount = 0;
const auto Start = Token->Tok.getEndLoc();
assert(!Line->InPPDirective);
Tok = nullptr;
for (const auto &L : llvm::reverse(*CurrentLines)) {
- if (!L.InPPDirective) {
- Tok = getLastNonComment(L);
- if (Tok)
- break;
+ if (!L.InPPDirective && getLastNonComment(L)) {
+ Tok = L.Tokens.back().Tok;
+ break;
}
}
assert(Tok);
Style);
verifyFormat("if (a) {\n"
+ " f(); // comment\n"
+ "}",
+ "if (a)\n"
+ " f(); // comment",
+ Style);
+
+ verifyFormat("if (a) {\n"
" f();\n"
"}\n"
"#undef A\n"