badopt1.c

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

C
16
字号
// Based on a testcase by Bryan Weston <bryanw@bluemoon.sps.mot.com>// egcs 1.1 fails to increment count// Special g++ Options: -O2struct Base { Base() {} }; // removing the constructor fixes the problemstruct Derived : Base {}; // so does removing the base classint main() {  int count = 0;  Derived* array[1]; // making this Base*[1] does not fix the problem  array[count++] = new Derived (); // but then new Base() does  if (count!=1)    return 1;}

⌨️ 快捷键说明

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