2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / crash28.C
blob4f1115be16d6c189075ea08978ed052c6cc4c1f6
1 // { dg-do assemble  }
2 // Origin: Jakub Jelinek <jakub@redhat.com>
4 namespace N
6   class X;
7   template <class T>
8   class Y
9   {
10   public:
11     inline Y () {}
12     inline operator const Y<X> & () const
13     {
14       return *reinterpret_cast<const Y<X> *>(this);
15     }
16   };
18 class bar
20 public:
21   inline bar () {}
22   inline bar (const ::N::Y< ::N::X>& a);
25 class foo
27   bool b;
28 public:
29   foo();
30   void x () throw(bar);
32 void foo::x() throw(bar)
34   if (!b) throw bar (static_cast<::N::X*>(this));       // { dg-error "" } parse error