Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bogus diagnostic deduction_guide_bad_trailing_return_type #54909

Open
hokein opened this issue Apr 14, 2022 · 0 comments · May be fixed by #117450
Open

bogus diagnostic deduction_guide_bad_trailing_return_type #54909

hokein opened this issue Apr 14, 2022 · 0 comments · May be fixed by #117450
Labels
clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer

Comments

@hokein
Copy link
Collaborator

hokein commented Apr 14, 2022

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>; 
@hokein hokein added the clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer label Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant