This is the mail archive of the 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] [PR13927] Dump alias_decl and fix duplicated error message (regression 3.4/mainline)

"Giovanni Bajo" <> writes:

| Hello,
| this patch makes error.c handle ALIAS_DECL just any other simple
| declartion,  thus fixing the diagnostic messages. It also removes a
| duplicated error message in case of redefinition of a symbol of
| different kind: in fact supplement_binding has the correct logic to
| handle this case, while duplicate_decls was trying to be smart and
| doing the work itself. 
| Notice that the position at which the previous declaration is
| reported is wrong (since it's at the end of the union). This is a
| different bug, I've xfailed it. 
| Tested on i686-pc-linux-gnu with no new regressions, OK for mainline
| and 3.4? 

The cp/error.c change is OK, but I don't agree with the change for

The comment at the front of supplement_binding is that it is the
caller's responsability to make sure that supplementing the binding is
OK.  In particular, supplement_binding should be not involed in any
direct diagnostic business.  I tried to fix that a while ago but
apparently I didn't get that chunk out.

Maybe, it is that it might make an easier code-path to follow to let
supplement_binding issue diagnostics but in that case, you need to
revisit duplicate_decls because there are many cases where
supplement_binding thinks the right things are done elsewhere.

(And, anyway, duplicate_decls is such a labyrinth that I'm very
cautious about any changes made to it :-)

-- Gaby

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