blob: 8cbe4d1948d349e0c6017aab5883c2cd619984b6 (
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
|
// { dg-do run }
struct S0 {
virtual int is_kind_of_S1 () const { return 0; }
virtual void dummy () { }
};
struct S1 : virtual public S0 {
virtual int is_kind_of_S1 () const { return 1; }
virtual void dummy () { }
};
struct S2 : virtual public S0 {
virtual void dummy () { }
};
struct S3 : public S2, public S1 {
virtual void dummy () { }
};
static struct S0 *var = new S3 ();
int main () {
if (var->is_kind_of_S1() != 1)
return 1;
return 0;
}
|