Author: owenca Date: 2022-08-21T23:26:51-07:00 New Revision: d90c1bcdf9a495507d7f1dbf829e8e00344bf12e
URL: https://github.com/llvm/llvm-project/commit/d90c1bcdf9a495507d7f1dbf829e8e00344bf12e DIFF: https://github.com/llvm/llvm-project/commit/d90c1bcdf9a495507d7f1dbf829e8e00344bf12e.diff LOG: Revert "[clang-format][NFC] Fix a bug in setting type FunctionLBrace" This reverts commit 35f7dd601d33219fafa2c0d308e187df3e36847a. Fixes #57200. Added: Modified: clang/lib/Format/UnwrappedLineParser.cpp clang/unittests/Format/TokenAnnotatorTest.cpp Removed: ################################################################################ diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index 77b928b629f6b..e7ce86b0a7524 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -1878,8 +1878,7 @@ void UnwrappedLineParser::parseStructuralElement( } else if (Style.BraceWrapping.AfterFunction) { addUnwrappedLine(); } - if (!Line->InPPDirective) - FormatTok->setFinalizedType(TT_FunctionLBrace); + FormatTok->setFinalizedType(TT_FunctionLBrace); parseBlock(); addUnwrappedLine(); return; diff --git a/clang/unittests/Format/TokenAnnotatorTest.cpp b/clang/unittests/Format/TokenAnnotatorTest.cpp index 8361a6c19085e..91af78c694f81 100644 --- a/clang/unittests/Format/TokenAnnotatorTest.cpp +++ b/clang/unittests/Format/TokenAnnotatorTest.cpp @@ -273,12 +273,6 @@ TEST_F(TokenAnnotatorTest, UnderstandsVariableTemplates) { EXPECT_TOKEN(Tokens[13], tok::ampamp, TT_BinaryOperator); } -TEST_F(TokenAnnotatorTest, UnderstandsLBracesInMacroDefinition) { - auto Tokens = annotate("#define BEGIN NS {"); - EXPECT_EQ(Tokens.size(), 6u) << Tokens; - EXPECT_TOKEN(Tokens[4], tok::l_brace, TT_Unknown); -} - TEST_F(TokenAnnotatorTest, UnderstandsDelete) { auto Tokens = annotate("delete (void *)p;"); EXPECT_EQ(Tokens.size(), 8u) << Tokens; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits