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] [PR2204] Check for parameters of abstract types (partial fix)


"Zack Weinberg" <zack@codesourcery.com> writes:

| Gabriel Dos Reis <gdr@integrable-solutions.net> writes:
| 
| > "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.
| 
| I don't understand this.  The %J consumes one argument and the %D
| consumes another one.  Why is this "wrong"?

The repetition oan information that is already there.  Any scheme that
requires repetition of information is wrong. 

| >   error ("%Jdeclaration '%D' is nonsensical", decl, decl); // WRONG
| >   error_at ("declaration '%+D' is nonsensical", decl); // Good
| 
| The %+D notation is tidier, but I had understood you to be of the
| opinion that it was not worth the implementation mess, nor the baggage
| of carrying around two different sets of diagnostic functions.

If you have error() recognizing '%+' properly then error_at() should
go.  The whole purpose of xxx_at() begin there is that xxx() does not
support yet '%+'.

-- Gaby


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