Skip to content

ClassScopeFunctionSpecializationDecl should not use the USR of its corresponding CXXMethodDecl #208

Closed
@sdkrystian

Description

@sdkrystian

Currently, if a class scope explicit specialization of a member function template of a class template has the same type as another non-template member function, they will both generate the same USR. This is because we generate the explicit specializations USR from the CXXMethodDecl returned by ClassScopeFunctionSpecializationDecl::getSpecialization. For example:

template<typename T>
struct A
{
    void f(int); // #1
    
    template<typename U>
    void f(U); // #2
    
    template<>
    void f<int>(int); // #3
};

Currently, functions 1 and 3 generate the same USR. This can be fixed by generating the USR for function 3 using the ClassScopeFunctionSpecializationDecl.

Activity

self-assigned this
on May 23, 2023
sdkrystian

sdkrystian commented on Jul 8, 2024

@sdkrystian
MemberAuthor

Will be fixed by llvm/llvm-project#98027.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @sdkrystian

      Issue actions

        `ClassScopeFunctionSpecializationDecl` should not use the USR of its corresponding `CXXMethodDecl` · Issue #208 · cppalliance/mrdocs