// Modified example from P2582R1 // { dg-do compile { target c++23 } } template struct B { B(T); }; B(bool) -> B; template struct C : public B { using B::B; }; template struct D : public B {}; C c(42); // OK, deduces C using ty1 = decltype(c); using ty1 = C; D d(42); // { dg-error "deduction|no match" } C c2(true); // OK, deduces C using ty2 = decltype(c2); using ty2 = C; template struct E : public B { using B::B; }; E e(42); // { dg-error "deduction|no match" } template struct F { F(T, U, V); }; template struct G : F { using F::F; }; G g(true, 'a', 1); // OK, deduces G using ty3 = decltype(g); using ty3 = G;