Skip to content

Commit 47423e9

Browse files
committed
[clang-format][NFC] Clean up IsQualifiedPointerOrReference in TokenAnnotator
1 parent 579dc7f commit 47423e9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

clang/lib/Format/TokenAnnotator.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -2753,10 +2753,9 @@ class AnnotatingParser {
27532753
}
27542754

27552755
// Heuristically try to determine whether the parentheses contain a type.
2756-
auto IsQualifiedPointerOrReference = [this](FormatToken *T) {
2756+
auto IsQualifiedPointerOrReference = [](FormatToken *T, bool IsCpp) {
27572757
// This is used to handle cases such as x = (foo *const)&y;
27582758
assert(!T->isTypeName(IsCpp) && "Should have already been checked");
2759-
(void)IsCpp; // Avoid -Wunused-lambda-capture when assertion is disabled.
27602759
// Strip trailing qualifiers such as const or volatile when checking
27612760
// whether the parens could be a cast to a pointer/reference type.
27622761
while (T) {
@@ -2789,7 +2788,7 @@ class AnnotatingParser {
27892788
!Tok.Previous ||
27902789
Tok.Previous->isOneOf(TT_TemplateCloser, TT_TypeDeclarationParen) ||
27912790
Tok.Previous->isTypeName(IsCpp) ||
2792-
IsQualifiedPointerOrReference(Tok.Previous);
2791+
IsQualifiedPointerOrReference(Tok.Previous, IsCpp);
27932792
bool ParensCouldEndDecl =
27942793
Tok.Next->isOneOf(tok::equal, tok::semi, tok::l_brace, tok::greater);
27952794
if (ParensAreType && !ParensCouldEndDecl)

0 commit comments

Comments
 (0)