aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr56310.C
blob: 04f6aa6b6ea939fed041ab408378f9eb093236fa (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
33
34
35
36
/* { dg-do compile { target c++11 } } */
/* { dg-options "-O -fipa-cp -fno-early-inlining -fipa-cp-clone --param=ipa-cp-eval-threshold=1" } */

void bar (void *, void *);

struct C
{
  constexpr C ():p (0)
  {
  }
  void *get ()
  {
    return p;
  }
  void *p;
};

struct B:C
{
};

struct A
{
  void f (B * x, B * y)
  {
    bar (x->get (), y->get ());
  }
};

void
foo ()
{
  A a;
  B b;
  a.f (&b, &b);
}