Debian Codegraph @

gcc/testsuite/g++.dg/ipa/pr81261.C

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fno-guess-branch-probability" } */
3
4 struct CBase {
5 virtual void BaseFunc () {}
6 };
7
8 struct MMixin {
9 virtual void * MixinFunc (int, void *) = 0;
10 };
11
12 struct CExample: CBase, public MMixin
13 {
14 void *MixinFunc (int arg, void *arg2)
15 {
16 if (arg != 1 || arg2)
17 return 0;
18 return this;
19 }
20 };
21
22 void *test (MMixin & anExample)
23 {
24 return anExample.MixinFunc (1, 0);
25 }
26
27 int main ()
28 {
29 CExample c;
30 return (test (c) != &c);
31 }