[all-commits] [llvm/llvm-project] 919df9: [clang][AST] Fix end location of DeclarationNameIn...

Balazs Benics via All-commits all-commits at lists.llvm.org
Wed May 22 08:41:53 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 919df9d75ac2a721a8072327c803f34486884571
      https://github.com/llvm/llvm-project/commit/919df9d75ac2a721a8072327c803f34486884571
  Author: Balazs Benics <benicsbalazs at gmail.com>
  Date:   2024-05-22 (Wed, 22 May 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/AST/Decl.h
    M clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
    M clang/unittests/AST/DeclTest.cpp

  Log Message:
  -----------
  [clang][AST] Fix end location of DeclarationNameInfo on instantiated methods (#92654)

Fixes #71161

[D64087](https://reviews.llvm.org/D64087) updated some locations of the
instantiated method but forgot `DNLoc`.

`FunctionDecl::getNameInfo()` constructs a `DeclarationNameInfo` using
`Decl::Loc` as the beginning of the declaration name, and
`FunctionDecl::DNLoc` to compute the end of the declaration name. The
former was updated, but the latter was not, so
`DeclarationName::getSourceRange()` would return a range where the end
of the declaration name could come before its beginning.

Patch by Alejandro Alvarez Ayllon
Co-authored-by: steakhal

CPP-5166

Co-authored-by: Alejandro Alvarez Ayllon <alejandro.alvarez at sonarsource.com>



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