c++: Implement P2582R1, CTAD from inherited constructors
[official-gcc.git] / gcc / testsuite / g++.dg / cpp23 / class-deduction-inherited4.C
blob5e3a7f42919e442d45537345d42437c828a1c5f1
1 // { dg-do compile { target c++23 } }
3 template<class T>
4 struct A { A(T); };
6 template<class T>
7 struct B : A<T> {
8   using B::A::A; // FIXME: we don't notice this inherited ctor
9 };
11 using ty1 = decltype(B(0)); // { dg-bogus "" "" { xfail *-*-* } }
12 using ty1 = B<int>;
14 template<class T=void>
15 struct C : A<int> {
16   using A<int>::A; // FIXME: we don't notice this one either
19 using ty2 = decltype(C(0)); // { dg-bogus "" "" { xfail *-*-* } }
20 using ty2 = C<void>;
22 template<class T>
23 struct D : A<T> {
24   using A<T>::A;
27 using ty3 = decltype(D(0));
28 using ty3 = D<int>;
30 A(int) -> A<char>; // FIXME: we need to rebuild the guides of D
31 using ty4 = decltype(D(0));
32 using ty4 = D<char>; // { dg-bogus "conflicting" "" { xfail *-*-* } }