[PR c++/67074] Namespace aliases to same name

Nathan Sidwell nathan@acm.org
Tue Jun 20 12:53:00 GMT 2017


This patch fixes a couple of places where namespace aliases refer to the 
same namespace.  These are not ambiguous or conflicting.

Firstly, aliases of the same name may exist in namespaces searched via 
using directives.  Those should be merged in lookup, which is the change 
to add_value.

Secondly, an alias to an existing namespace of the same name in the same 
scope is ok.  The change to duplicate_decls calms it down -- all it 
should do is say 'yup, this is the same decl', and disregard 
conflictingness -- that's pushdecl's problem.  Which is the change to 
update_binding.  As it happens, duplicate_decls will have already 
eliminated matching aliases, but it needs to be taught to permit an 
alias to the same named namespace to be allowed.

And finally diagnose_name_conflict needs to treat namespaces as always 
conflicting.  It's confusing to say the second instance is a redeclaration.

Applied to trunk.

nathan
-- 
Nathan Sidwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 67074.diff
Type: text/x-patch
Size: 4609 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20170620/28075cfa/attachment.bin>


More information about the Gcc-patches mailing list