gcc/testsuite/g++.dg/eh/spec4.C
raw| 1 | // PR c++/5104 |
| 2 | // Test that a function with a throw spec is a valid template argument. |
| 3 | |
| 4 | #include <exception> |
| 5 | |
| 6 | typedef void (*HandlerFunction)(); |
| 7 | typedef HandlerFunction (*SetHandlerFunction)(HandlerFunction); |
| 8 | |
| 9 | template <SetHandlerFunction set_function> |
| 10 | class HandlerStack { |
| 11 | public: |
| 12 | static void defaultHandler(); |
| 13 | }; |
| 14 | |
| 15 | typedef HandlerStack<std::set_terminate> Terminate; |
| 16 | |
| 17 | template<> void Terminate::defaultHandler() {} |