incomplete1.c

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

C
22
字号
// { dg-do compile }// Contributed by Brian Gaeke; public domain.// 5 If the object being deleted has incomplete class type at the// point of deletion and the complete class has a non-trivial// destructor or a deallocation function, the behavior is undefined.// (But the deletion does not constitute an ill-formed program. So the// program should nevertheless compile, but it should give a warning.)class A;	// { dg-warning "forward declaration of `struct A'" "" }A *a;		// { dg-warning "`a' has incomplete type" "" }intmain (int argc, char **argv){  delete a;	// { dg-warning "delete" "" { xfail *-*-* } }  return 0;}

⌨️ 快捷键说明

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