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: Y()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: bar()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 () 31 #if __cplusplus <= 201402L 32 throw(bar) // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } } 33 #endif 34 ; 35 }; x()36void foo::x() 37 #if __cplusplus <= 201402L 38 throw(bar) // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } } 39 #endif 40 { 41 if (!b) throw bar (static_cast<::N::X*>(this)); // { dg-error "lambda expressions|expected|invalid" } parse error 42 } 43