Before:
constexpr char hello [] { "hello" };
After:
constexpr char hello[]{ "hello" };
llvm-svn: 190046
}
void UnwrappedLineParser::tryToParseLambda() {
+ // FIXME: This is a dirty way to access the previous token. Find a better
+ // solution.
+ if (!Line->Tokens.empty() && Line->Tokens.back().Tok->is(tok::identifier)) {
+ nextToken();
+ return;
+ }
assert(FormatTok->is(tok::l_square));
FormatToken &LSquare = *FormatTok;
if (!tryToParseLambdaIntroducer())
" x.end(), //\n"
" [&](int, int) { return 1; });\n"
"}\n");
+
+ // Not lambdas.
+ verifyFormat("constexpr char hello[]{ \"hello\" };");
}
TEST_F(FormatTest, FormatsBlocks) {