unexpected1.c

来自「this is a gcc file, you can download it 」· C语言 代码 · 共 47 行

C
47
字号
// PR 3719// Test that an unexpected handler can rethrow to categorize.// { dg-do run }#include <exception>extern "C" void abort ();struct One { };struct Two { };static voidhandle_unexpected (){  try  {    throw;  }  catch (One &)  {    throw Two ();  }}static voiddoit () throw (Two){  throw One ();}int main (){  std::set_unexpected (handle_unexpected);  try  {    doit ();  }  catch (Two &)  {  }  catch (...)  {    abort ();  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?