[clang] [clang][Parser] Fix FunctionDecl source range for out-of-class '= delete'/'= default' definitions (PR #167007)

Yanzuo Liu via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 9 06:11:29 PST 2025


================
@@ -1341,12 +1343,15 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D,
           << 1 /* deleted */;
       BodyKind = Sema::FnBodyKind::Delete;
       DeletedMessage = ParseCXXDeletedFunctionMessage();
+      FuncRangeEnd = clang::Lexer::getLocForEndOfToken(KWLoc, 0, PP.getSourceManager(), getLangOpts()).getLocWithOffset(-1);
----------------
zwuis wrote:

`= delete("reason")` (C++26 feature) is not handled correctly.

https://github.com/llvm/llvm-project/pull/167007


More information about the cfe-commits mailing list