1// PR debug/52260
2// { dg-do compile { target c++11 } }
3// { dg-options "-gdwarf-4" }
4
5namespace { typedef decltype (nullptr) T1; }
6struct B {};
7namespace A
8{
9  template <typename T, T __v>
10  struct C { static constexpr T value = __v; };
11  typedef C <bool, false> D;
12  template <typename>
13  struct E : D {};
14  template <typename T>
15  struct F : C <bool, (E <T>::value)> {};
16  template <bool, typename T = void>
17  struct G { typedef T t; };
18}
19template <typename T>
20struct H {};
21namespace A
22{
23  template <typename T>
24  struct I : H <T> {};
25  template <typename ...> struct J {};
26  template <typename> struct K;
27  struct L
28  {
29    template <typename B2>
30    struct M
31    {
32      template <typename T> static bool m2 (T) { return false; }
33    };
34  };
35  template <typename, typename> struct N;
36  template <typename T, typename B2, typename ... B4>
37  struct N <T (B4 ...), B2> : L::M <B2> {};
38  template <typename T, typename ... B4>
39  struct K <T (B4 ...)> :J <>, L
40  {
41    typedef T O (B4 ...);
42    struct P {};
43    template <typename B2> K (B2, typename G <!F <B2>::value, P>::t = P ());
44  };
45  template <typename T, typename ... B1>
46  template <typename B2>
47  K <T (B1 ...)>::K (B2 __f, typename G <!F < B2>::value, P>::t)
48  {
49    typedef N <O, B2> Q;
50    Q::m2 (__f);
51  };
52}
53enum R { r1 };
54const R r2 = r1;
55namespace A
56{
57  template <typename>
58  struct S {};
59  template <typename T, typename _Dp = S <T>>
60  struct U {};
61  template <typename T, R _Lp = r2>
62  struct V { T *operator -> (); };
63  template <typename T>
64  struct W : V <T>
65  {
66    W (const W &);
67    W (T1) {}
68    W & operator= (W) {}
69  };
70  template <typename> struct Z;
71  struct AA
72  {
73    struct AB
74    {
75      struct AC { void operator () () {} };
76    };
77    template <typename T> using AD = U <T, AB::AC>;
78    struct AE
79    {
80      typedef AD <AB> AZ;
81      virtual ~AE ();
82      void o3 (K <AZ ()>, bool = false) {}
83      template <typename, typename _Arg> struct AY;
84      struct C1 {};
85      template <typename T> struct AY <T, C1>
86      {
87	AZ operator () () { return AZ (); }
88        Z <T> _M_Z;
89      };
90      template <typename T>
91      static AY <T, C1> _s1 (B, Z <T> *);
92    };
93  };
94  template <>
95  struct Z <void>
96  {
97    typedef AA::AE AF;
98    W <AF> o4;
99    void foo (B __p)
100    {
101      auto _s1 = AF::_s1 (__p, this);
102      o4->o3 (_s1);
103    }
104  };
105  template <typename T, typename _Alloc>
106  struct AG {};
107  template <typename T, typename D1 = A::I <T>>
108  struct AH : AG <T, D1>
109  {
110    void bar (T) { baz (); }
111    template <typename ... _Args>
112    void baz (_Args && ...);
113  };
114  template <typename T, typename D1>
115  template <typename ... _Args>
116  void AH <T, D1>::baz (_Args && ...) {}
117  namespace
118  {
119    typedef A::K <void ()> AI;
120    struct AF
121    {
122      int v2;
123      AI v1;
124      AF (int, unsigned, AI __t) : v2 (), v1 (__t) {}
125    };
126    struct D3 : A::AH <AF>
127    {
128      typedef AF AFT;
129      void v3 (AI __t) { bar (AFT (4, v4, __t)); }
130      int v4;
131    };
132  }
133}
134