curdeius added inline comments.
================ Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1791 + tokenCanStartNewLine(*FormatTok) && Text == Text.upper() && + !PreviousToken->isTypeFinalized()) { PreviousToken->setFinalizedType(TT_FunctionLikeOrFreestandingMacro); ---------------- owenpan wrote: > Can we simply do this and leave `FormatTokenLexer` alone? We can too. It seemed hacky to me because we can miss `TT_UntouchableMacroFunc` in other places. Setting the token type finalized in the lexer will avoid such problems in the future. I'm okay however to just apply your suggestion. ================ Comment at: clang/unittests/Format/FormatTest.cpp:23545 + // Newlines are important here. + EXPECT_EQ("FOO(1+2 );\n", format("FOO(1+2 );\n", Style)); + EXPECT_EQ("FOO(1+2 )\n", format("FOO(1+2 )\n", Style)); ---------------- owenpan wrote: > Do we really need this test case? Not really. I just wrote it to cover both cases but it's covered by existing cases indeed. Will remove. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123676/new/ https://reviews.llvm.org/D123676 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits