aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-1.C
blob: 69bd6a61d4fb338efff390fe3ff68382294b2034 (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
/* { dg-do compile } */
/* { dg-options "-O3"  } */

struct CBase {
  virtual void BaseFunc () {}
};

struct MMixin {
  virtual void * MixinFunc (int, void *) = 0;
};

struct CExample: CBase, public MMixin
{
  void *MixinFunc (int arg, void *arg2)
  {
    if (arg != 1 || arg2)
      return 0;
    return this;
  }
};

void *test (MMixin & anExample)
{
  return anExample.MixinFunc (1, 0);
}

int main ()
{
  CExample c;
  test (c);
  return 0;
}