https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102933
Bug ID: 102933
Summary: Can't use CTAD in template argument
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: johelegp at gmail dot com
CC: johelegp at gmail dot com
Target Milestone: ---
See https://godbolt.org/z/P8xq8h9M1.
```C++
template<class T> struct X { T t; };
template<X> void f();
template<class T> void g() {
f<X{T{0}}>();
}
int main() {
g<int>();
}
```
```
<source>: In function 'void g()':
<source>:7:5: error: invalid use of 'X<...auto...>' in template argument
7 | f<X{T{0}}>();
| ^
Compiler returned: 1
```