| Issue |
164264
|
| Summary |
[Clang] Missing default template argument in synthesized guides during CTAD for alias template
|
| Labels |
clang
|
| Assignees |
|
| Reporter |
MagentaTreehouse
|
```c++
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:
```console
<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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs