ctors19.c

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

C
34
字号
// { dg-do assemble  }// GROUPS passed constructors// ctor file// From: mkohtala@vinkku.hut.fi// Date: Tue, 5 Oct 1993 19:31:16 +0200// Message-Id: <199310051731.AA12260@lk-hp-11.hut.fi>// Subject: Nested class constructor calling bugclass X{  public:    class Y    {      public:        Y(int i) : a(i) {}        int a;    };    static void f(Y y);};void X::f(X::Y y){}intmain(){    X::Y y = X::Y(1);   // Tries to call ctor Y instead of X::Y    X::f(X::Y(2));      // Tries to call Y instead of X::Y    return 0;}

⌨️ 快捷键说明

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