gcc/testsuite/g++.dg/cpp0x/noexcept31.C
raw| 1 | // PR c++/77369 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | template<typename F> int caller(F f) noexcept(noexcept(f())) { f(); return 0; } |
| 5 | |
| 6 | void func1() noexcept { } |
| 7 | |
| 8 | void func2() { throw 1; } |
| 9 | |
| 10 | int instantiate_caller_with_func1 = caller(func1); |
| 11 | |
| 12 | static_assert( !noexcept(caller(func2)), "" ); |