[C++ PATCH] [PR13086] Clarification of diagnostic on delete of an incomplete type (regression on 3.3/trunk)

Gabriel Dos Reis gdr@integrable-solutions.net
Thu Jan 15 15:35:00 GMT 2004


"Giovanni Bajo" <giovannibajo@libero.it> writes:

| incomplete1.C:19: warning: possible problem detected in invocation of delete
| operator:
| incomplete1.C:14: warning: `a' has incomplete type
| incomplete1.C:12: warning: forward declaration of `struct A'
| incomplete1.C:19: note: the generated code will not work, unless the class does
| not have a destructor nor a delete operator.


I like your use of inform() -- it is for one of those things I introduced
it for.

I have a preference for

    inform ("the generated code may not work")

i.e. scratch althogeter mention to "destructor" and "delete operator".

Also scratch the "possible problem detected..." bits.

I suggest you change

  incomplete1.C:14: warning: `a' has incomplete type

to

  incomplete1.C:14: warning: pointer 'a' points to an object of
     incomplete type

The object/pointer 'a' has a *complete* type -- a pointer to data
always has a complete type.   

I'm not sure about the "foward declaration" wording though.  You may
leave it as is for the moment.  With those changes, the patch is OK.

-- Gaby



More information about the Gcc-patches mailing list