Skip to content

Commit 38dd67c

Browse files
committed
[clang-format][NFC] Minor cleanup of the parser and annotator
1 parent 5fabc8b commit 38dd67c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

clang/lib/Format/TokenAnnotator.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4141,8 +4141,7 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line,
41414141
(Style.SpacesInSquareBrackets &&
41424142
Right.MatchingParen->isOneOf(TT_ArraySubscriptLSquare,
41434143
TT_StructuredBindingLSquare,
4144-
TT_LambdaLSquare)) ||
4145-
Right.MatchingParen->is(TT_AttributeParen));
4144+
TT_LambdaLSquare)));
41464145
}
41474146
if (Right.is(tok::l_square) &&
41484147
!Right.isOneOf(TT_ObjCMethodExpr, TT_LambdaLSquare,

clang/lib/Format/UnwrappedLineParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2660,7 +2660,7 @@ void UnwrappedLineParser::handleAttributes() {
26602660
// Handle AttributeMacro, e.g. `if (x) UNLIKELY`.
26612661
if (FormatTok->is(TT_AttributeMacro))
26622662
nextToken();
2663-
if (FormatTok->is(tok::l_square))
2663+
else if (FormatTok->is(tok::l_square))
26642664
handleCppAttributes();
26652665
}
26662666

0 commit comments

Comments
 (0)