| 1 |
// PR c++/114903 |
| 2 |
// { dg-do compile { target c++20 } } |
| 3 |
|
| 4 |
template <typename T> |
| 5 |
struct Key { |
| 6 |
Key(int); |
| 7 |
}; |
| 8 |
|
| 9 |
class Forward {}; |
| 10 |
|
| 11 |
template <typename T> |
| 12 |
constexpr bool C = __is_same(T, Forward); |
| 13 |
|
| 14 |
template <typename Z> |
| 15 |
struct Outer { |
| 16 |
template <typename U> |
| 17 |
struct Foo { |
| 18 |
Foo(U); |
| 19 |
U u; |
| 20 |
}; |
| 21 |
|
| 22 |
template <typename V> |
| 23 |
requires(C<Z>) |
| 24 |
Foo(V) -> Foo<int>; |
| 25 |
}; |
| 26 |
|
| 27 |
template <typename Y> |
| 28 |
struct T { |
| 29 |
template <typename Y2> |
| 30 |
struct T2 { |
| 31 |
template <typename K> |
| 32 |
using AFoo = Outer<Y2>::template Foo<K>; |
| 33 |
}; |
| 34 |
}; |
| 35 |
|
| 36 |
T<Forward>::T2<Forward>::AFoo a(1.0); |
| 37 |
using type = decltype(a); |
| 38 |
using type = Outer<Forward>::Foo<int>; |