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 usingdecl involving variable declaration)
Kriang Lerdsuwanakij wrote:
Mark Mitchell wrote:
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"?
Because do_toplevel_using_decl never calls supplement_binding. From what
I see, supplement_binding is mainly intended for struct stat hack (with
a few other case thrown in). And then there is DR400. I could try a
different approach, using
supplement_binding and such in do_toplevel_using_decl.
Oh, I missed that this was a toplevel binding.
The real problem here, of course, is that we have such different code
paths for top-level bindings from local bindings; there's nothing in the
language that implies that these things should be so different. But,
that's a big project.
By the way, the patch was already approved and committed:
http://gcc.gnu.org/ml/gcc-patches/2005-03/msg01771.html
So it has to be taken out and replaced if we want to fix it
in a different way.
I think it's OK. It might result in some duplicate diagnostics, in the
worst case.
Thanks,
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304