2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.jason / crash4.C
blob70f054b6eaf49c270faccfeea60766d5e5fd10f5
1 // { dg-do assemble  }
2 // PRMS Id: 4346
3 // Bug: g++ dies on redefinition of cc_Array::repInvariant.
5 class ccObjectInfo
7 public:
8     virtual const ccObjectInfo& repInvariant (int =0) const;
9 };
11 template <class T>
12 class cc_Array : public ccObjectInfo
14 public:
15   virtual const ccObjectInfo& repInvariant (int =0) const ;
18 template <class T>
19 const ccObjectInfo& cc_Array<T>::repInvariant(int) const
20 {  return *this /* *this is required here */; } // { dg-error "" } redefined
22 template <class T>
23 class ccArray :public ccObjectInfo
25   ccArray (cc_Array<T>*);
28 template <class T>
29 class ccObjArray : public ccArray<T>
31   ccObjArray();
32 }; 
34 template <class T>
35 const ccObjectInfo& cc_Array<T>::repInvariant(int) const
36 {  return 0; }                  // { dg-error "" } causes compiler segfault
38 typedef ccObjArray< double>     ccROIRuns;