static6.c

来自「用于进行gcc测试」· C语言 代码 · 共 36 行

C
36
字号
// PR c++/31806// { dg-do run }// { dg-options "-O2 -fno-inline -fno-threadsafe-statics" }extern "C" void abort(void);struct A{    void *d;};static const A& staticA(){    static A s_static;    return s_static;}void assert_failed(){    abort();}A testMethod(){    static const A& s = staticA( );    if (&s == 0)        assert_failed();    return s;}int main(){    testMethod();    return 0;}

⌨️ 快捷键说明

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