⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spec4.c

📁 linux下编程用 编译软件
💻 C
字号:
// { dg-do run  }// Testing exception specifications.// Test 4: all throws fail, call terminate.#include <stdlib.h>#include <exception>void my_term ()  { exit (0); }void my_unexp () { throw 42; }voidf () throw (short){  throw 'a';}int main (){  std::set_terminate (my_term);  std::set_unexpected (my_unexp);  try    {      f ();    }  catch (char)    {      return 2;    }  catch (int)    {      return 3;    }  catch (std::bad_exception)    {      return 4;    }  return 5;}

⌨️ 快捷键说明

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