c++: prvalue of array type [PR111286]
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / noexcept06.C
blob0183ad6d91816cde08f73464cc73d7671eaa9912
1 // Test that checking of a nothrow specification uses the one on the
2 // definition.
3 // { dg-do run { target { c++11 && { ! c++23 } } } }
4 // { dg-options "-Wno-terminate" }
6 #include <exception>
7 #include <cstdlib>
9 void my_unexpected ()
11   std::abort ();
13 void my_terminate ()
15   std::exit (0);
18 void f() throw();
19 void f() noexcept
21   throw 1;
24 int main()
26   std::set_unexpected (my_unexpected); // { dg-warning "deprecated" }
27   std::set_terminate (my_terminate);
28   f();
29   return 1;