init7.c

来自「俄罗斯高人Mamaich的Pocket gcc编译器(运行在PocketPC上)」· C语言 代码 · 共 31 行

C
31
字号
// simplified from testcase in Windows Developer Journal,// submitted by eyal.ben-david@aks.com// The initialization of a static local variable must be retried if a// previous try finished by throwing an exception [stmt.dcl]/4extern "C" void abort ();struct foo {  foo() { throw true; }};void bar() {  static foo baz;}int main() {  try {    bar(); // must throw  }  catch (bool) {    try {      bar(); // must throw again!    }    catch (bool) {      return 0;    }  }  abort();}

⌨️ 快捷键说明

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