[C++ PATCH] [PR2204] Check for parameters of abstract types (partial fix)
Gabriel Dos Reis
gdr@integrable-solutions.net
Tue Feb 10 02:50:00 GMT 2004
"Zack Weinberg" <zack@codesourcery.com> writes:
| Gabriel Dos Reis <gdr@integrable-solutions.net> writes:
|
| > "Giovanni Bajo" <giovannibajo@libero.it> writes:
| >
| > | if (TREE_CODE (decl) == VAR_DECL)
| > | ! error ("%Jcannot declare variable `%D' to be of abstract type `%T'",
| > | ! decl, decl, type);
| >
| > That is an abuse of %J. Use error_at instead.
| [etc]
|
| I told Giovanni that error/warning/pedwarn_at were to be eliminated in
| favor of %J. Did I misunderstand what you've said about these in the
| past?
I don't know exactly what you're referring to. But, the repetition of
the "decl" is not right and if any removal should lead to that, then
that removal should not happen.
There are some uses of error_at which are wrong. E.g.
error_at ("foo is nonsensical", decl); // WRONG
error ("%Jfoo is nonsensical", decl); // Good
error ("%Jdeclaration '%D' is nonsensical", decl, decl); // WRONG
error_at ("declaration '%+D' is nonsensical", decl); // Good
-- Gaby
More information about the Gcc-patches
mailing list