Author: Owen Pan Date: 2024-03-23T02:24:56-07:00 New Revision: 47423e9827abfdcc6b10ce41618965861b0e69a4
URL: https://github.com/llvm/llvm-project/commit/47423e9827abfdcc6b10ce41618965861b0e69a4 DIFF: https://github.com/llvm/llvm-project/commit/47423e9827abfdcc6b10ce41618965861b0e69a4.diff LOG: [clang-format][NFC] Clean up IsQualifiedPointerOrReference in TokenAnnotator Added: Modified: clang/lib/Format/TokenAnnotator.cpp Removed: ################################################################################ diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index 7757c8ff76398f..4c83a7a3a323be 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -2753,10 +2753,9 @@ class AnnotatingParser { } // Heuristically try to determine whether the parentheses contain a type. - auto IsQualifiedPointerOrReference = [this](FormatToken *T) { + auto IsQualifiedPointerOrReference = [](FormatToken *T, bool IsCpp) { // This is used to handle cases such as x = (foo *const)&y; assert(!T->isTypeName(IsCpp) && "Should have already been checked"); - (void)IsCpp; // Avoid -Wunused-lambda-capture when assertion is disabled. // Strip trailing qualifiers such as const or volatile when checking // whether the parens could be a cast to a pointer/reference type. while (T) { @@ -2789,7 +2788,7 @@ class AnnotatingParser { !Tok.Previous || Tok.Previous->isOneOf(TT_TemplateCloser, TT_TypeDeclarationParen) || Tok.Previous->isTypeName(IsCpp) || - IsQualifiedPointerOrReference(Tok.Previous); + IsQualifiedPointerOrReference(Tok.Previous, IsCpp); bool ParensCouldEndDecl = Tok.Next->isOneOf(tok::equal, tok::semi, tok::l_brace, tok::greater); if (ParensAreType && !ParensCouldEndDecl) _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits