-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Open
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"
Description
template <class T, auto = 0>
struct A {
A(T) {}
};
template <class T, class U>
using Foo = A<T, U{}>;
template <class T, class U = int>
using Bar = Foo<T, U>;
Bar a{0};Output:
<source>:12:5: error: no viable constructor or deduction guide for deduction of template arguments of 'Bar'
12 | Bar a{0};
| ^
<source>:10:1: note: candidate template ignored: couldn't infer template argument 'U'
10 | using Bar = Foo<T, U>;
| ^
<source>:10:1: note: implicit deduction guide declared as 'template <class T, class U> requires __is_deducible(Foo, A<T, U{}>) && __is_deducible(Bar, A<T, U{}>) Bar(T) -> A<T, U{}>'
<source>:10:1: note: candidate template ignored: could not match 'A<T, U{}>' against 'int'
<source>:10:1: note: implicit deduction guide declared as 'template <class T, class U> requires __is_deducible(Foo, A<T, U{}>) && __is_deducible(Bar, A<T, U{}>) Bar(A<T, U{}>) -> A<T, U{}>'See https://compiler-explorer.com/z/vcjc1qEfv.
See also #133132.
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"