summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/ctor3.C
blob: d3eb2c3f8a55e362f531f7fdbb7e730ed6e1006f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
struct A {};
struct B;

template <class TP> struct X: virtual A {
  template <class TP2> X(TP2* ptr) {}
  template <class TP2> X(const X<TP2>) {}
};

struct Y : X<B> { 
  Y(A* a) : X<B>(a) {}
};

void func1(X<B>);

void func2() {
  A a;
  Y y(&a);
  func1(X<A>(&a));
}