diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/noexcept07.C')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/noexcept07.C | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept07.C b/gcc/testsuite/g++.dg/cpp0x/noexcept07.C new file mode 100644 index 000000000..0a5773fc8 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/noexcept07.C @@ -0,0 +1,25 @@ +// Test that checking of a nothrow specification uses the one on the +// definition. +// { dg-options "-std=c++0x" } +// { dg-do run } + +#include <exception> +#include <cstdlib> + +void my_unexpected () +{ + std::exit (0); +} + +void f() noexcept; +void f() throw() +{ + throw 1; +} + +int main() +{ + std::set_unexpected (my_unexpected); + f(); + return 1; +} |