[all-commits] [llvm/llvm-project] 6f64e7: [Clang][AST] Add source range for deleted and defa...

Shreyansh Lodha via All-commits all-commits at lists.llvm.org
Fri Jul 17 07:29:07 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6f64e7cf0ad7699a5f1e6b2418d4c2cdcdb26470
      https://github.com/llvm/llvm-project/commit/6f64e7cf0ad7699a5f1e6b2418d4c2cdcdb26470
  Author: Shreyansh Lodha <lodhashreyansh1603 at gmail.com>
  Date:   2026-07-17 (Fri, 17 Jul 2026)

  Changed paths:
    M clang/lib/Parse/ParseCXXInlineMethods.cpp
    M clang/lib/Parse/Parser.cpp
    M clang/test/AST/ast-dump-decl.cpp
    A clang/test/AST/ast-dump-deleted-defaulted-range.cpp
    M clang/test/AST/ast-dump-funcs.cpp
    M clang/test/AST/ast-dump-record-definition-data-json.cpp
    M clang/test/Analysis/inlining/Inputs/expected-plists/path-notes.cpp.plist
    M clang/test/CoverageMapping/default-method.cpp
    M clang/unittests/AST/SourceLocationTest.cpp
    M clang/unittests/Tooling/RecursiveASTVisitorTests/CXXMethodDecl.cpp

  Log Message:
  -----------
  [Clang][AST] Add source range for deleted and defaulted functions (#205408)

Earlier wrong ranges for default and deleted functions were reported.
Post this fix all ranges for functions are reported.

Fix: Extended the declarator's source range to include the delete /
default tokens by calling
D.SetRangeEnd(PP.getLocForEndOfToken(KilLoc).getLocWithOffset(-1)) after
consuming each keyword in ParseFunctionDefinition. Previously, the range
ended at the function name, onitting the delete/default specifier
entirely.

Regression tested and no regressions found.


Assisted-by: Claude Code (Anthropic) — used in developing this patch.

Closes #64805



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list