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
35
36
37
|
// { dg-do run }
template <class T, class V>
class A {
public:
A (T at, V av);
void print () { }
protected:
T t;
V v;
};
template <class T, class V>
A<T, V>::A (T at, V av) {
t = at;
v = av;
}
template <class T, class V>
class B: public virtual A<T, V> {
public:
B (T at, V av);
void print () { }
};
template <class T, class V>
B<T, V>::B (T at, V av) : A<T, V> (at, av) { } // { dg-bogus "" }
int main () {
int i = 2;
double x = 2;
B<int, double> ab(i, x);
ab.print();
return 0;
}
|