1 // Modified example from P2582R1
2 // { dg-do compile { target c++23 } }
4 template <typename T> struct B {
8 template <typename T> struct C : public B<T> {
11 template <typename T> struct D : public B<T> {};
13 C c(42); // OK, deduces C<int>
14 using ty1 = decltype(c);
17 D d(42); // { dg-error "deduction|no match" }
19 C c2(true); // OK, deduces C<char>
20 using ty2 = decltype(c2);
23 template <typename T> struct E : public B<int> {
27 E e(42); // { dg-error "deduction|no match" }
29 template <typename T, typename U, typename V> struct F {
32 template <typename T, typename U> struct G : F<U, T, int> {
33 using F<U, T, int>::F;
36 G g(true, 'a', 1); // OK, deduces G<char, bool>
37 using ty3 = decltype(g);
38 using ty3 = G<char, bool>;