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;