🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #3894

Re: delete vs incomplete class type

#3894
From: Nathan Myers, http://www.cantrip...
Date: Tue, 02 Apr 1996 19:11
34 lines
2108 bytes
Steven Correll (sjc@netcom.com) wrote:
>         struct x;
>         struct y;
>
>         void
>         p(x *arg0, y *arg1)
>         {
>           delete [] arg0;
>           delete arg1;
>         }
>
> I don't see how a compiler could avoid noticing that it hasn't a clue what
> destructor to invoke at compilation time. Is there a reason ... not to 
> require the compiler to diagnose this as an error, instead of allowing 
> it to fault at execution time?

I have to agree with Steven ... it's silly to talk about preserving
legacy C code that has "delete" statements in it.  Given the great
difficulty in finding bugs introduced this way, and the great ease of
introducing them accidentally through inclusion errors, we certainly
should change something.

Fortunately fixing this would be a restriction, not an extension,
and thus is still conceivable in this round of standardization.

Nathan Myers
ncm@cantrip.org  http://www.cantrip.org/
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu 
]
Technical Details
Message-ID: <3160CA2D.646FFC15@cantrip.org>
Path: arc1-ca.pugleaf.net!fido.asd.sgi.com!austern
References: <sjcDownA7.6FA@netcom.com> <4jcdp0$b3p@venus.mcs.com> <sjcDp7BEy.3J4@netcom.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!fido.asd.sgi.com!austern
From: "Nathan Myers, http://www.cantrip.org/" <ncm@cantrip.org>
Newsgroups: comp.std.c++
Subject: Re: delete vs incomplete class type
Date: 02 Apr 1996 11:11:42 PST
Organization: The Cantrip Cooperative
Approved: austern@isolde.mti.sgi.com
Message-ID: <3160CA2D.646FFC15@cantrip.org>
References: <sjcDownA7.6FA@netcom.com> <4jcdp0$b3p@venus.mcs.com> <sjcDp7BEy.3J4@netcom.com>
NNTP-Posting-Host: isolde.mti.sgi.com
X-Original-Date: Mon, 01 Apr 1996 22:33:17 -0800
X-Mailer: Mozilla 2.01 (X11; I; Linux 1.2.13 i386)
X-Auth: PGPMoose V1.1 PGP comp.std.c++
 iQBVAwUBMWF78Ey4NqrwXLNJAQGJaAH9GgP0mdKMUwZBy/unlEgcnXZtgcaooovk
 aZbVY3ORnKmucv+51nUFfjzO0lZaM0nZBYSAMzqkg7DWV7nYwXoleA==
 =QzTS
Originator: austern@isolde.mti.sgi.com