* c-common.c (get_priority): Add check for
[official-gcc.git] / gcc / testsuite / g++.dg / other / pr24623.C
blob480bb39b63ae59292c350e09e7fc3b63df767dcf
1 /* This used to ICE due to a backend problem on s390.  */
3 /* { dg-do compile } */
4 /* { dg-options "-O1" } */
6 class ReferenceCounted
8 public:
10   virtual ~ ReferenceCounted ()
11   {
12   }
13   void decrementRefCount () const
14   {
15     if (--const_cast < unsigned int &>(_ref_count) == 0)
16       {
17         delete this;
18       }
19   }
20   unsigned int _ref_count;
23 template < class T > class RefCountPointer
25 public:
27 RefCountPointer (T * p = 0):_p (p)
28   {
29   }
30   RefCountPointer & operator= (const RefCountPointer < T > &o)
31   {
32     if (_p != o._p)
33       {
34         if (_p != 0)
35           _p->decrementRefCount ();
36       }
37   }
38   ~RefCountPointer ()
39   {
40   }
41   T *_p;
43 class Item:public ReferenceCounted
45 public:
47   typedef RefCountPointer < const Item > Ptr;
49 class AnyAtomicType:public Item
52 class StaticContext
55 class DynamicContext:public StaticContext
58 class SortableItem
60   SortableItem ();
61   int m_bAscending:1;
62   DynamicContext *m_context;
63     AnyAtomicType::Ptr m_item;
65 SortableItem::SortableItem ()
67   m_context = __null;
68   m_item = __null;