[C++ PATCH] [PR13927] Dump alias_decl and fix duplicated error message (regression 3.4/mainline)

Gabriel Dos Reis gdr@integrable-solutions.net
Mon Feb 2 21:25:00 GMT 2004


"Giovanni Bajo" <giovannibajo@libero.it> 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
duplicate_decls. 

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



More information about the Gcc-patches mailing list