1// PR c++/44148
2// { dg-do compile }
3// { dg-options "" }
4// { dg-options "-fpic" { target fpic } }
5
6template <typename T> struct S2
7{
8  typedef const T &t2;
9  t2 operator* () const {}
10};
11template <typename T> struct S3
12{
13  typedef S2 <T> t5;
14};
15template <typename T1, typename T2> T2 foo1 (T1 x, T2 y) { y (*x); }
16template <class T> struct S4
17{
18  T &operator* () const;
19};
20struct S7 {};
21struct S8
22{
23  typedef::S3 <S4 <S7> >::t5 t6;
24  t6 m1 () const;
25};
26template <class T> struct S9
27{
28  typedef T t3;
29  inline t3 &operator[] (unsigned int) {}
30};
31template <typename T1, typename T2, typename T3, void (&T4) (const T1 &, T3 &)> struct S10
32{
33  S10 (T2 &x, unsigned int y = 0) : u (x), v (y) {}
34  void operator () (const S4 <T1> &x) { T4 (*x, u[v++]); }
35  T2 &u;
36  unsigned int v;
37};
38struct S15;
39struct S11
40{
41  static void m3 (const S8 &, S15 &);
42};
43struct S16;
44struct S12;
45struct S13
46{
47  static void m4 (const S7 &,S16 &);
48};
49typedef S10 <S7, S12, S16, S13::m4> t10;
50struct S12: S9 <S16>
51{
52};
53struct S15
54{
55  S12 p;
56};
57void S11::m3 (const S8 &x, S15 &y)
58{
59  foo1 (x.m1 (), t10 (y.p));
60}
61