This is the mail archive of the gcc-bugs@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]

[Bug c++/13086] [3.3/3.4 regression] the location of the warning message is wrong when calling delete on incomplete type


------- Additional Comments From gdr at integrable-solutions dot net  2003-11-20 03:16 -------
Subject: Re:  [3.3/3.4 regression] the location of the warning message is wrong when calling delete on incomplete type

"falk at debian dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| (In reply to comment #6)
| > "falk dot hueffner at student dot uni-tuebingen dot de"
| <gcc-bugzilla@gcc.gnu.org> writes:
| > 
| > | "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."
| > | 
| > | which would be pointless if this was a hard error.
| > 
| > But GCC can decide to define that behaviour to be hard error.
| 
| Only if both conditions are given. The object here has incomplete class,
| but it does not have a destructor (well, not shown above, but let's assume.).

Any object type has a destructor.  The fact that the type is incomplete at
the point of deleting does not morally rule out that fact. 
Deleting an object with an incomplete type simply does not make sense.

| > I believe I discussed -- a while ago -- this specific issue with Jason,
| Alexandre Oliva.
| > I argued that the compiler should issue a hard error.  I was in minority :-(
| > 
| > I still think, this should be a hard error.
| 
| I wouldn't mind at all if it was, because this is a completely useless
| feature which could potentially do some damage, but I think it would not be
| standard compliant.

Certainly, it is standard conformant.  The issue here is purely a
Quality of Implementation issue. 

-- Gaby  


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13086


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