summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/crash28.C
blob: 59f1e844eeab50be2d893ac43a7e35536d073943 (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
// { dg-do assemble  }
// Origin: Jakub Jelinek <jakub@redhat.com>

namespace N
{
  class X;
  template <class T>
  class Y
  {
  public:
    inline Y () {}
    inline operator const Y<X> & () const
    {
      return *reinterpret_cast<const Y<X> *>(this);
    }
  };
}
class bar
{
public:
  inline bar () {}
  inline bar (const ::N::Y< ::N::X>& a);
};

class foo
{
  bool b;
public:
  foo();
  void x () throw(bar);
};
void foo::x() throw(bar)
{
  if (!b) throw bar (static_cast<::N::X*>(this));	// { dg-error "lambda expressions|expected" } parse error
}