Revert "[clang-format][NFC] Fix a bug in setting type FunctionLBrace"

This reverts commit 35f7dd601d.

Fixes #57200.
This commit is contained in:
owenca 2022-08-21 21:32:50 -07:00
parent 7d6e7d5445
commit d90c1bcdf9
2 changed files with 1 additions and 8 deletions

View File

@ -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;

View File

@ -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;