This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[C++ Patch] PR 43452


Hi,

this very old minor issue is about the kind of diagnostic we want to produce for something like the existing g++.dg/init/delete1.C:

class C;

 void foo(void *p) {
  delete [] ((C*)p) ;
 }

that is when the array delete is called for a pointer to incomplete type. Currently we emit an hard error (we used to ICE) but arguably we should only warn and explain the possible undefined behavior at runtime, consistently with what we do for the non-array variant of delete (clang and icc likewise warn). I tested the below on x86_64-linux.

Thanks!
Paolo.

///////////////////////

Attachment: CL_43452
Description: Text document

Attachment: patch_43452
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]