https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114974
Bug ID: 114974
Summary: CTAD: gcc rejects some valid code
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: hokein.wu at gmail dot com
Target Milestone: ---
gcc trunk rejects the following valid CTAD code:
```
template<typename T1>
struct A1 {
template<typename T2>
struct A2 { T2 t; };
};
template <typename K>
void s(K k) {
A1<int>::A2 a(2);
}
void s() {
s<double>(1.0);
}
```
https://godbolt.org/z/7bxEbhP47
It looks like in this case gcc fails? to generate the aggregate deduction
guide.