Skip to content

bogus diagnostic deduction_guide_bad_trailing_return_type #54909

@hokein

Description

@hokein

The following code is passed in gcc and msvc, but clang gives a bogus diagnostic deduced type 'B<T>' (aka 'A<type-parameter-0-0>') of deduction guide is not written as a specialization of template 'A'.

The reason is that when clang compares the equality of two Template-kind TemplateName, it doesn't seem to consider the TypeAliasTemplateDecl case.

template<typename T> struct A {};
A(void) -> A<int>;

template<typename T> using B = A<T>; 

template<typename T> A(T) -> B<T>; 

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions