aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1z/inh-ctor26.C
blob: 28dc33227a88fa40cb87858e3a78f7a685b5f7f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Testcase from P0136
// { dg-do compile { target c++11 } }
// { dg-options -fnew-inheriting-ctors }

struct A {
  template<typename T> A(T, typename T::type = 0);
  A(int);
};
struct B : A {
  using A::A;
  B(int);
};
B b(42L); // now calls B(int), used to call B<long>(long),
          // which called A(int) due to substitution failure
          // in A<long>(long).

// { dg-final { scan-assembler "_ZN1BC1Ei" } }