Skip to content

Reference collapsing works wrong #50

@adromanov

Description

@adromanov

For the following piece of code:

template <class T>
void foo(T && t)
{ }

struct Test {};

int main()
{
    Test test;
    foo(test);
    return 0;
}

output of an instantiation of foo is the following:

/* First instantiated from: insights.cpp:10 */
#ifdef INSIGHTS_USE_TEMPLATE
template<>
void foo<Test &>(Test && t)
{
}
#endif

Argument type should be Test & but not Test && because of reference collapsing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions