summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/other/pr42645-2.C
blob: 67632e51d91286dc4c43822082c5d0d613d8de74 (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
// PR tree-optimization/42645
// { dg-do compile }
// { dg-options "-fcompare-debug -O1" }

struct C
{
  bool b;
  C ();
};

static inline C *foo () {}

extern void f4 ();

static inline int
f3 ()
{
  f4 ();
}

static inline void
f2 (bool b)
{
  int tmp = f3 ();
  if (C ().b && b)
    C ();
}

void
f1 ()
{
  C *c = foo ();
  f2 (c->b);
}