summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/crash4.C
blob: 00ba0cc0644e4ad708f24fb1191fa532f85619a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// { dg-do assemble  }
// PRMS Id: 4346
// Bug: g++ dies on redefinition of cc_Array::repInvariant.

class ccObjectInfo
{
public:
    virtual const ccObjectInfo& repInvariant (int =0) const;
};

template <class T>
class cc_Array : public ccObjectInfo
{
public:
  virtual const ccObjectInfo& repInvariant (int =0) const ;
};

template <class T>
const ccObjectInfo& cc_Array<T>::repInvariant(int) const  // { dg-error "previously declared" }
{  return *this /* *this is required here */; }

template <class T>
class ccArray :public ccObjectInfo
{
  ccArray (cc_Array<T>*);
};

template <class T>
class ccObjArray : public ccArray<T>
{
  ccObjArray();
}; 

template <class T>
const ccObjectInfo& cc_Array<T>::repInvariant(int) const // { dg-error "redefinition" }
{  return 0; }

typedef ccObjArray< double>	ccROIRuns;