Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / other / pr52048.C
blob7edd283cbd2533faa23b7578097a265d512b91d6
1 // PR debug/52048
2 // { dg-do compile }
3 // { dg-options "-fcompare-debug -fnon-call-exceptions -fno-tree-dominator-opts -O2 -Wno-return-type" }
5 template <typename T> struct A;
6 template <typename T>
7 struct A <T *>
9   typedef T &a;
11 template <typename T>
12 struct B
14   typedef typename A <T>::a a;
15   a operator *() {}
17 template <typename T, typename U>
18 bool operator != (B <T>, B <U>)
21 template <typename T>
22 struct C
24   typedef T *c;
25   template <typename>
26   struct D { typedef C d; };
28 template <typename T, typename U> struct E
30   typedef typename U::template D <T>::d e;
32 template <typename T, typename U = C <T> >
33 struct F
35   typedef E <T, U> b;
36   typedef typename b::e e;
37   typedef typename e::c c;
38   typedef B <c> i;
39   i begin ();
40   i end ();
42 class G;
43 class H;
44 struct I
46   void *i;
47   template <typename T> T foo ();
49 struct J : public I
51   virtual bool bar ();
53 class K {};
54 struct L
56   bool baz () {}
58 struct M
60   K m1 (K);
61   K m2 (H *) {}
63 struct N : J
65   bool bar (G &);
67 bool
68 N::bar (G &)
70   M m = foo <M> ();
71   F <H *> f;
72   for (F <H *>::i I = f.begin (), E = f.end (); I != E;)
73     {
74       H *h = *I;
75       L l;
76       if (l.baz ())
77         m.m1 (m.m2 (h));
78     }