1 // { dg-do compile }
2 // { dg-additional-options "-Wno-return-type" }
3 
4 typedef __SIZE_TYPE__ size_t;
5 
6 class c1;
7 
8 class c2 {
c2()9   public: c2() { };
10   void *operator new(size_t size, const c1 & crc1);
11 };
12 
13 class c3 {
c3()14   public: c3() { _Obj = 0; }
~c3()15   ~c3() { if (_Obj) delete _Obj; }
16   void set(c2 *pObj);
17   protected: c2 *_Obj;
18 };
19 
set(c2 * pObj)20 void c3::set(c2 *pObj) { _Obj = pObj; };
21 
22 template<class TYPE> class tc1 : public c2 {
23   public: tc1(int n=0){};
24   int get() const;
25   TYPE& operator[] (int id);
26   TYPE * _data;
27   int _size;
28 };
29 
30 template<class TYPE> TYPE & tc1<TYPE>::operator[] (int id) {
31   return _data[id];
32 }
33 
get()34 template<class TYPE> int tc1<TYPE>::get() const {
35   return _size;
36 }
37 
38 class c4 {
39   public: c4();
40 };
41 
42 class c5 : public c2 {
43   protected: c2 * _own;
c5(c2 * o)44   public: c5(c2 *o) : _own(o) { }
45   c5(const c4 & box);
46   int add(const c4 & ext);
47 };
48 
49 class c6 {
get()50   public: int get() const { return 0; };
51 };
52 
53 class c7 {
54   friend class c8;
55   int find(c6 * loop) const;
56 };
57 
58 class c8 {
59   const c1 & _rc1;
60   int tria(c7 * face, c5 * vtree0 = 0);
61 };
62 
tria(c7 * face,c5 * vtree0)63 int c8::tria(c7 * face, c5 * vtree0) {
64   c6 *sLData[64];
65   tc1<c6*> loops(64);
66   while (loops.get() > 1) {
67     c6 *iloop = 0;
68     for (int j=1; j<loops.get(); j++) {
69       if (loops[j]->get() < 32) {
70         iloop = loops[j];
71       }
72     }
73     face->find(iloop);
74   }
75   c4 box;
76   c3 ctree;
77   c5 *vtree = vtree0;
78   if (!vtree) {
79     vtree = new (_rc1) c5(box);
80     ctree.set(vtree);
81     for (int j=0; j<1; j++) {
82       c4 sVBBox;
83       vtree->add(sVBBox);
84     }
85   }
86 }
87