diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/crash28.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/crash28.C | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash28.C b/gcc/testsuite/g++.old-deja/g++.other/crash28.C new file mode 100644 index 000000000..59f1e844e --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/crash28.C @@ -0,0 +1,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 +} |