ctors18.c

来自「linux下编程用 编译软件」· C语言 代码 · 共 28 行

C
28
字号
// { dg-do assemble  }// GROUPS passed constructorsclass test1 {};template<class T>class GC_PTR {public:  GC_PTR(T &a) {}};voidgotPtrs(GC_PTR<test1> r1){}static voidshort_alloc(int n){        test1 here;        GC_PTR<test1> foo = here;   // This works fine.        gotPtrs(here);              // Compile error from this        // No constructor named `GC_PTR` in visible scope        // conversion between incompatible aggregate types requested}

⌨️ 快捷键说明

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