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
f1(S x,T y,U z)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>
f2(S x,T y,U z)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>
f5C29   static S f5 (S x, T y, U z) { f2 (x, y, z); return S(); }
30 };
31 
32 template <typename S, typename T, typename U>
f6(S x,T y,U z)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>
f7(S x,T y,U z,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;
EE42   E (int x) : g(f) { f8 (x); }
43   ~E ();
44   D g;
f9E45   void f9 (int x) { x ? B::f3 (g, x) : char (); }
f8E46   void f8 (int x) { f9 (x); }
47 };
48 
49 struct F : E
50 {
FF51   F (int x) : E(x) { f10 (x); f4 (this, 0); }
52   char h;
f10F53   void f10 (int x) { f7 (&g.e, x, h, 0); }
54 };
55 
56 long a;
57 
58 void
test()59 test ()
60 {
61   F b(a);
62 }
63