Before:
#define LIST(L) \
L(FirstElement) L(SecondElement) L(ThirdElement) L(FourthElement) \
L(FifthElement)
After:
#define LIST(L) \
L(FirstElement) \
L(SecondElement) \
L(ThirdElement) \
L(FourthElement) \
L(FifthElement)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198407
91177308-0d34-0410-b5e6-
96231b3b80d8
// Recognize function-like macro usages without trailing semicolon.
if (FormatTok->Tok.is(tok::l_paren)) {
parseParens();
- if (FormatTok->HasUnescapedNewline &&
+ if (FormatTok->NewlinesBefore > 0 &&
tokenCanStartNewLine(FormatTok->Tok)) {
addUnwrappedLine();
return;
" IPC_END_MESSAGE_MAP()\n"
"}"));
+ // Same inside macros.
+ EXPECT_EQ("#define LIST(L) \\\n"
+ " L(A) \\\n"
+ " L(B) \\\n"
+ " L(C)",
+ format("#define LIST(L) \\\n"
+ " L(A) \\\n"
+ " L(B) \\\n"
+ " L(C)",
+ getGoogleStyle()));
+
// These must not be recognized as macros.
EXPECT_EQ("int q() {\n"
" f(x);\n"