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]

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


"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


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