111
|
1 // PR target/69432
|
|
2 // { dg-do compile }
|
|
3 // { dg-options "-O3" }
|
|
4 // { dg-additional-options "-minline-stringops-dynamically" { target i?86-*-* x86_64-*-* } }
|
|
5
|
|
6 template <typename S, typename T, typename U>
|
|
7 void
|
|
8 f1 (S x, T y, U z)
|
|
9 {
|
|
10 for (; y; --y, ++x)
|
|
11 *x = z;
|
|
12 }
|
|
13
|
|
14 template <typename S, typename T, typename U>
|
|
15 void f2 (S x, T y, U z)
|
|
16 {
|
|
17 f1 (x, y, z);
|
|
18 }
|
|
19
|
|
20 struct A {};
|
|
21 struct B { static char f3 (A, unsigned); };
|
|
22
|
|
23 template <typename S, typename U>
|
|
24 void f4 (S, U);
|
|
25
|
|
26 struct C
|
|
27 {
|
|
28 template <typename S, typename T, typename U>
|
131
|
29 static S f5 (S x, T y, U z) { f2 (x, y, z); return S(); }
|
111
|
30 };
|
|
31
|
|
32 template <typename S, typename T, typename U>
|
|
33 void f6 (S x, T y, U z) { C::f5 (x, y, z); }
|
|
34
|
|
35 template <typename S, typename T, typename U, typename V>
|
|
36 void f7 (S x, T y, U z, V) { f6 (x, y, z); }
|
|
37
|
|
38 struct E
|
|
39 {
|
|
40 struct D : A { char e; D (A); };
|
|
41 A f;
|
|
42 E (int x) : g(f) { f8 (x); }
|
|
43 ~E ();
|
|
44 D g;
|
|
45 void f9 (int x) { x ? B::f3 (g, x) : char (); }
|
|
46 void f8 (int x) { f9 (x); }
|
|
47 };
|
|
48
|
|
49 struct F : E
|
|
50 {
|
|
51 F (int x) : E(x) { f10 (x); f4 (this, 0); }
|
|
52 char h;
|
|
53 void f10 (int x) { f7 (&g.e, x, h, 0); }
|
|
54 };
|
|
55
|
|
56 long a;
|
|
57
|
|
58 void
|
|
59 test ()
|
|
60 {
|
|
61 F b(a);
|
|
62 }
|