111
|
1 // { dg-do compile }
|
|
2 template <class _T1> struct A
|
|
3 {
|
|
4 _T1 first;
|
|
5 };
|
|
6 struct B
|
|
7 {
|
|
8 int operator!=(B);
|
|
9 };
|
|
10 template <typename _Tp> struct C
|
|
11 {
|
|
12 C (B);
|
|
13 _Tp operator*();
|
|
14 int operator!=(C);
|
|
15 };
|
|
16 template <typename _Tp> class D
|
|
17 {
|
|
18 public:
|
|
19 typedef C<_Tp> const_iterator;
|
|
20 const_iterator m_fn1 () const;
|
|
21 B m_fn2 ();
|
|
22 void m_fn3 ();
|
|
23 };
|
|
24 class F
|
|
25 {
|
|
26 struct G
|
|
27 {
|
|
28 static G &
|
|
29 m_fn5 ()
|
|
30 {
|
|
31 void fn1 ();
|
|
32 return *reinterpret_cast<G *> (fn1);
|
|
33 }
|
|
34 int *
|
|
35 m_fn6 ()
|
|
36 {
|
|
37 return reinterpret_cast<int *> (this);
|
|
38 }
|
|
39 };
|
|
40 struct _Alloc_hider
|
|
41 {
|
|
42 _Alloc_hider (int *p1, int) : _M_p (p1) {}
|
|
43 int *_M_p;
|
|
44 } _M_dataplus;
|
|
45 G &
|
|
46 m_fn4 ()
|
|
47 {
|
|
48 return G::m_fn5 ();
|
|
49 }
|
|
50 public:
|
|
51 F () : _M_dataplus (m_fn4 ().m_fn6 (), 0) {}
|
|
52 };
|
|
53 class H
|
|
54 {
|
|
55 void m_fn7 (const F &, bool &);
|
131
|
56 void m_fn8 (const D<F> &, const F &, F &);
|
111
|
57 };
|
|
58 typedef A<int> CandPair;
|
|
59 class I
|
|
60 {
|
|
61 public:
|
|
62 virtual void m_fn9 (const F &, bool, D<CandPair> &);
|
|
63 };
|
|
64 class J : I
|
|
65 {
|
|
66 public:
|
|
67 void m_fn9 (const F &, bool, D<CandPair> &);
|
|
68 };
|
|
69 D<I *> c;
|
|
70 void
|
|
71 J::m_fn9 (const F &, bool, D<CandPair> &)
|
|
72 {
|
|
73 D<int> a;
|
|
74 for (B b; b != a.m_fn2 ();)
|
|
75 ;
|
|
76 }
|
|
77 inline void
|
|
78 fn2 (F p1, int, int, J *p4, D<CandPair>)
|
|
79 {
|
|
80 D<CandPair> d;
|
|
81 d.m_fn3 ();
|
|
82 p4->m_fn9 (p1, 0, d);
|
|
83 for (D<I *>::const_iterator e = c.m_fn1 (); e != c.m_fn2 ();)
|
|
84 (*e)->m_fn9 (p1, 0, d);
|
|
85 }
|
|
86 void
|
|
87 H::m_fn7 (const F &, bool &)
|
|
88 {
|
|
89 A<F> f;
|
|
90 D<F> g;
|
|
91 F h;
|
|
92 m_fn8 (g, f.first, h);
|
|
93 }
|
131
|
94 void
|
111
|
95 H::m_fn8 (const D<F> &p1, const F &, F &)
|
|
96 {
|
|
97 F i;
|
|
98 p1.m_fn1 ();
|
|
99 D<CandPair> j;
|
|
100 fn2 (i, 0, 0, 0, j);
|
|
101 }
|