summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ipa/pr44372.C
blob: 22aa747e4351b73c3971aed5710fef9c77cdead8 (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
37
38
39
40
41
42
43
44
45
46
47
48
/* { dg-do compile } */
/* { dg-options "-O -fipa-cp -fipa-cp-clone" } */

template < typename > class S3;

struct S1
{
  struct
  {
    int i[10];
  } s0;
  S1 () : s0 ()
  { }
  template < typename T > S1 (S3 < T > s3, int)
  {
    f (s3);
  }
};

struct S2
{
  template < typename T > S2 s (S3 < T > s3)
  {
    S1 (s3, 0);
  }
  S2 (int i) : j (i)
  { }
  int j;
  S1 s1[10];
};

template < typename > struct S3
{
  S3 ()
  {
    S2 (0).s (*this);
  }
};

static inline void
f (S3 < int > s3)
{
  extern bool m;
  if (m)
    S2 (0).s (s3);
}

S3 < int >s3;