This is the mail archive of the
mailing list for the GCC project.
Re: [C++ PATCH] [PR2204] Check for parameters of abstract types (partial fix)
"Giovanni Bajo" <email@example.com> writes:
| Gabriel Dos Reis wrote:
| > As a side comment, I don't understand why you went through that
| > change.
| This is the rationale for my changes to abstract_virtual_errors.
| * Use of %J (will be error_at):
| With my patch, abstract_virtual_errors can be deferred to an indefinite moment
| (when the type is completed). Without this change, the error message appears on
| the last line of the completed type, which is wrong: we need to show the user
| where is the parameter whose type is abstract. Then, the other messages about
| the pure virtual functions will point her to the functions which need to be
| overridden, and thus to the type.
That makes sense.
| * Rewording
| There is no such thing as an "abstract virtual function". Standard calls it
| "pure virtual function".
I agree too. I've been seeing those messages these last days (personal
experience forgetting to define dozens of pure virtual functions in a
very complex class hierarchy). They look indeed indeed very odd.
| * Use of inform vs error
| Those messages are just additional information provided to help the user, they
| are not part of the error message proper. Moreover, I heard someone wanted to
| have a -fno-notes mode one day, so it makes sense to be able to shut those off.
| This is also why I added the word "abstract" on the first error line, so that
| it is now a complete error message, and the notes are really optional. Before,
| the first line would have been unclear, were the notes disabled for some
This makes sense.
| Sorry, I should have mentioned these things in the patch message.
No need to sorry. What I don't understand is the use of '%J' in lieu