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: [PATCH][RFC] C++ error for parameter redefinition in function prototypes


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


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