Skip to content

Commit

Permalink
[clang-format][NFC] Remove superfluous code in UnwrappedLineParser
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D156643
  • Loading branch information
owenca committed Aug 1, 2023
1 parent 9ecdbe3 commit adece4e
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions clang/lib/Format/UnwrappedLineParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1188,8 +1188,8 @@ void UnwrappedLineParser::parsePPUnknown() {
static bool tokenCanStartNewLine(const FormatToken &Tok) {
// Semicolon can be a null-statement, l_square can be a start of a macro or
// a C++11 attribute, but this doesn't seem to be common.
assert(Tok.isNot(TT_AttributeSquare));
return Tok.isNot(tok::semi) && Tok.isNot(tok::l_brace) &&
Tok.isNot(TT_AttributeSquare) &&
// Tokens that can only be used as binary operators and a part of
// overloaded operator names.
Tok.isNot(tok::period) && Tok.isNot(tok::periodstar) &&
Expand Down Expand Up @@ -3646,12 +3646,7 @@ bool UnwrappedLineParser::parseEnum() {
// We can have macros or attributes in between 'enum' and the enum name.
if (FormatTok->is(tok::l_paren))
parseParens();
if (FormatTok->is(TT_AttributeSquare)) {
parseSquare();
// Consume the closing TT_AttributeSquare.
if (FormatTok->Next && FormatTok->is(TT_AttributeSquare))
nextToken();
}
assert(FormatTok->isNot(TT_AttributeSquare));
if (FormatTok->is(tok::identifier)) {
nextToken();
// If there are two identifiers in a row, this is likely an elaborate
Expand Down

0 comments on commit adece4e

Please sign in to comment.