Open
Description
template <class T>
struct A {};
template <class T>
using Foo = A<A<T>>;
template <class T = int>
using Bar = Foo<T>;
Bar a{};
Output:
<source>:10:5: error: no viable constructor or deduction guide for deduction of template arguments of 'Bar'
10 | Bar a{};
| ^
<source>:8:1: note: candidate template ignored: couldn't infer template argument 'T'
8 | using Bar = Foo<T>;
| ^
<source>:8:1: note: implicit deduction guide declared as 'template <class T> requires __is_deducible(Foo, A<A<T>>) && __is_deducible(Bar, A<A<T>>) Bar() -> A<A<T>>'
<source>:8:1: note: candidate function template not viable: requires 1 argument, but 0 were provided
2 | struct A {};
| ~
3 |
4 | template <class T>
5 | using Foo = A<A<T>>;
6 |
7 | template <class T = int>
8 | using Bar = Foo<T>;
| ^
<source>:8:1: note: implicit deduction guide declared as 'template <class T> requires __is_deducible(Foo, A<A<T>>) && __is_deducible(Bar, A<A<T>>) Bar(A<A<T>>) -> A<A<T>>'
1 error generated.