FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.jason / crash4.C
blobbf6a15c370aa6f6474830366f15822b4999335ae
1 // PRMS Id: 4346
2 // Bug: g++ dies on redefinition of cc_Array::repInvariant.
3 // Build don't link:
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 */; } // 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; }                  // ERROR - causes compiler segfault
38 typedef ccObjArray< double>     ccROIRuns;