filter2.c

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

C
60
字号
// Test that terminate gets run when a catch filter fails to match while// running destructors.  Original bug depended on a::~a being inlined.// { dg-do run }// { dg-options -O }#include <exception>#include <cstdlib>struct e1 {};struct e2 {};struct a{  a () { }  ~a ()    {      try	{	  throw e1();	}      catch (e2 &)	{        }    }};voidex_test (){  a aa;  try    {      throw e1 ();    }  catch (e2 &)    {    }}void my_terminate (){  std::exit (0);}intmain (){  std::set_terminate (my_terminate);  try    {      ex_test ();    }  catch (...)    {    }  abort ();}

⌨️ 快捷键说明

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