Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / gcc / testsuite / g++.old-deja / g++.other / crash28.C
1 // { dg-do assemble  }
2 // Origin: Jakub Jelinek <jakub@redhat.com>
3
4 namespace N
5 {
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   };
17 }
18 class bar
19 {
20 public:
21   inline bar () {}
22   inline bar (const ::N::Y< ::N::X>& a);
23 };
24
25 class foo
26 {
27   bool b;
28 public:
29   foo();
30   void x () throw(bar);
31 };
32 void foo::x() throw(bar)
33 {
34   if (!b) throw bar (static_cast<::N::X*>(this));       // { dg-error "lambda expressions|expected|invalid" } parse error
35 }