summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/template41.C
blob: a2f667f247b964ced98d8cb138bdc7ccfe8bf21f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// { dg-do run  }
// PRMS Id: 11420
// Bug: Can't handle indirect virtual template base init.

extern "C" int printf (const char *, ...);

template<class T>
class Vbase {
 public:
  Vbase(T i) { printf ("%d\n", i); }
};

template<class T>
class D1 : virtual public Vbase<T> {
 public:
  D1(T i) : Vbase<T>(i) {}
};

template<class T>
class D2 : virtual public Vbase<T> {
 public:
  D2(T i) : Vbase<T>(i) {}
};

template<class T>
class Most : public D1<T>, public D2<T> {
 public:
  Most(T i) : D1<T>(i), D2<T>(i), Vbase<T>(i) {}
};

int main () {
  Most<int> x(2);
  return 0;
}