1// { dg-do assemble } 2// PRMS Id: 4346 3// Bug: g++ dies on redefinition of cc_Array::repInvariant. 4 5class ccObjectInfo 6{ 7public: 8 virtual const ccObjectInfo& repInvariant (int =0) const; 9}; 10 11template <class T> 12class cc_Array : public ccObjectInfo 13{ 14public: 15 virtual const ccObjectInfo& repInvariant (int =0) const ; 16}; 17 18template <class T> 19const ccObjectInfo& cc_Array<T>::repInvariant(int) const // { dg-error "previously declared" } 20{ return *this /* *this is required here */; } 21 22template <class T> 23class ccArray :public ccObjectInfo 24{ 25 ccArray (cc_Array<T>*); 26}; 27 28template <class T> 29class ccObjArray : public ccArray<T> 30{ 31 ccObjArray(); 32}; 33 34template <class T> 35const ccObjectInfo& cc_Array<T>::repInvariant(int) const // { dg-error "redefinition" } 36{ return 0; } 37 38typedef ccObjArray< double> ccROIRuns; 39