Debian Codegraph @

gcc/testsuite/g++.dg/ipa/pr61160-3.C

raw
1 /* { dg-do run } */
2 /* { dg-options "-O3" } */
3
4 struct A {
5 void *p;
6 A (void *q) : p (q) {}
7 A (const A &) : p () {}
8 };
9
10 struct CBase {
11 virtual void BaseFunc () {}
12 };
13
14 struct MMixin {
15 virtual A MixinFunc (int, A) = 0;
16 };
17
18 struct CExample: CBase, public MMixin
19 {
20 A MixinFunc (int arg, A arg2)
21 {
22 if (arg != 1 || arg2.p)
23 return 0;
24 return this;
25 }
26 };
27
28 void *test (MMixin & anExample)
29 {
30 return anExample.MixinFunc (1, (0)).p;
31 }
32
33 int main ()
34 {
35 CExample c;
36 test (c);
37 return 0;
38 }