summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/opt/inline12.C
blob: d9eae306dc50d65007bf728632125e287b6962cf (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
// PR tree-optimization/33458
// { dg-do compile }
// { dg-options "-O" }

inline void
foo (int *p, int n)
{
  for (; n > 0; --n, ++p)
    *p = 0;
}

struct A
{
  int x[2];
  A () { foo (x, 2); }
};

inline A
getA ()
{
  return A ();
}

struct B
{
  A a;
  B ();
};

B::B () : a (getA ())
{
}