Skip to content

[clangd] Incorrect navigation caused by deducing this #116335

@ymyh

Description

@ymyh
struct B
{
    template<typename Self>
    auto bar(this Self &&) 
    {
        return 0;
    }

    auto bar2(this B &&)
    {
        return 0;
    }
};

struct A
{
    auto foo()
    {
        return B{};
    }
};

auto baz(int n)
{
    return n;
}

int main()
{
    A a{};
    baz(a.foo().bar());

    A a2{};
    int n  = a2.foo().bar2();
}

incorrect navigation of a.foo and a to baz, a2.foo and a2 to n

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions