Skip to content

CTAD for alias templates fails with non-template explicit deduction guide #94927

@antangelo

Description

@antangelo

Example:

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

A(int) -> A<char>;

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

A a2(100);
B b2(100);

using A2 = A<char>;
using A2 = decltype(a2); // works

using B2 = B<char>;
using B2 = decltype(b2); // fails, deduces A<int>

https://godbolt.org/z/v5W1M4TKq

Metadata

Metadata

Assignees

Labels

c++20clang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second party

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions