State.Stack.back().VariablePos = VariablePos;
}
- if (Current.is(tok::string_literal)) {
+ if (Current.is(tok::string_literal) && State.StartOfStringLiteral == 0) {
State.StartOfStringLiteral = State.Column;
- } else if (Current.isNot(tok::comment)) {
- State.StartOfStringLiteral = 0;
+ } else if (!Current.isOneOf(tok::comment, tok::identifier, tok::hash,
+ tok::string_literal)) {
}
State.Column += Current.FormatTok.TokenLength;
"#define LL_FORMAT \"ll\"\n"
"printf(\"aaaaa: %d, bbbbbb: %\" LL_FORMAT \"d, cccccccc: %\" LL_FORMAT\n"
" \"d, ddddddddd: %\" LL_FORMAT \"d\");");
+
+ verifyFormat("#define A(X) \\\n"
+ " \"aaaaa\" #X \"bbbbbb\" \\\n"
+ " \"ccccc\"",
+ getLLVMStyleWithColumns(23));
+ verifyFormat("#define A \"def\"\n"
+ "f(\"abc\" A \"ghi\"\n"
+ " \"jkl\");");
}
TEST_F(FormatTest, AlignsPipes) {