[PATCH][RFC] C++ error for parameter redefinition in function prototypes

Gabriel Dos Reis gdr@cs.tamu.edu
Fri Apr 27 14:06:00 GMT 2007


Mark Mitchell <mark@codesourcery.com> writes:

| Simon Baldwin wrote:
| 
| > I've attached a new version of the patch below.  Please take another
| > look when you get the opportunity.
| 
| This version looks good to me, with one minor adjustment:
| 
| > +       if (DECL_NAME (decl))
| > +         {
| > +           if (pointer_set_contains (unique_decls, DECL_NAME (decl)))
| > +             error ("redefinition of parameter %qD", decl);
| 
| Here, I think it would be better to say:
| 
|   error ("multiple parameters named %qD", DECL_NAME (decl));
                                        ^

Please use "E" here, as the DECL_NAME is not a declaration, but an
expression (IDENTIFIER_NODE).

-- Gaby



More information about the Gcc-patches mailing list