| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O -fipa-cp -fipa-cp-clone -Wno-return-type" } */ |
| 3 |
|
| 4 |
template < typename > class S3; |
| 5 |
|
| 6 |
struct S1 |
| 7 |
{ |
| 8 |
struct |
| 9 |
{ |
| 10 |
int i[10]; |
| 11 |
} s0; |
| 12 |
S1 () : s0 () |
| 13 |
{ } |
| 14 |
template < typename T > S1 (S3 < T > s3, int) |
| 15 |
{ |
| 16 |
f (s3); |
| 17 |
} |
| 18 |
}; |
| 19 |
|
| 20 |
struct S2 |
| 21 |
{ |
| 22 |
template < typename T > S2 s (S3 < T > s3) |
| 23 |
{ |
| 24 |
S1 (s3, 0); |
| 25 |
} |
| 26 |
S2 (int i) : j (i) |
| 27 |
{ } |
| 28 |
int j; |
| 29 |
S1 s1[10]; |
| 30 |
}; |
| 31 |
|
| 32 |
template < typename > struct S3 |
| 33 |
{ |
| 34 |
S3 () |
| 35 |
{ |
| 36 |
S2 (0).s (*this); |
| 37 |
} |
| 38 |
}; |
| 39 |
|
| 40 |
static inline void |
| 41 |
f (S3 < int > s3) |
| 42 |
{ |
| 43 |
extern bool m; |
| 44 |
if (m) |
| 45 |
S2 (0).s (s3); |
| 46 |
} |
| 47 |
|
| 48 |
S3 < int >s3; |