This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH for 3.4/4.0/4.1] Fix PR20240 (Accepting invalid using decl involving variable declaration)
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: lerdsuwa at users dot sourceforge dot net, gcc-patches at gcc dot gnu dot org
- Date: 21 Mar 2005 03:52:53 +0100
- Subject: Re: [C++ PATCH for 3.4/4.0/4.1] Fix PR20240 (Accepting invalid using decl involving variable declaration)
- Organization: Integrable Solutions
- References: <4232E3DC.2010400@users.sf.net><423E2620.1080109@codesourcery.com>
Mark Mitchell <mark@codesourcery.com> writes:
| Kriang Lerdsuwanakij wrote:
| > Hi
| > This patch fixes PR20240, a regression on 3.3 up to mainline.
| > There is a problem deciding whether name from using declaration
| > and locally declared name conflicts. That check relies on
| > decls_match. Unlike typedef (no conflict if both refer to the
| > same type), it is always a conflict when they are variable
| > declaration. The patch adds a missing check inside decls_match.
| > Tested on i686-pc-linux-gnu. OK for mainline, 3.4 and 4.0 branches?
|
| I'm not convinced this is the right place to detect the error.
|
| Why aren't we issuing an error in supplement_binding, when we try to
| add the USING_DECL for "a" to the existing binding for "a"?
A traditional invariant of supplement_binding() is that it does not
issue diagnostic and caller is supposed to check. I have no idea of
why that invariant was put in the first place:
It's the responsibility of the caller to check that
inserting this name is valid here. Returns nonzero if the new binding
was successful. */
but I think that we may get duplicate diagnostics.
-- Gaby