conv3.c

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

C
32
字号
// PR 31074// Bug: The reference cast wasn't finding the desired static_cast followed by// const_cast interpretation.struct Shape{  Shape() {}  virtual ~Shape() {}};struct Loop{  Loop() {}  virtual ~Loop() {}  virtual void func() {}};struct Rect :  public Shape,  public Loop{  Rect() {}  virtual ~Rect() {}};int main (){  const Rect* rect = new Rect();  Loop &l = ((Loop&)(*rect));  return (&l != (const Loop *)rect);}

⌨️ 快捷键说明

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