c++: Instantiation with local extern [PR97395]
authorNathan Sidwell <nathan@acm.org>
Wed, 14 Oct 2020 12:06:54 +0000 (05:06 -0700)
committerNathan Sidwell <nathan@acm.org>
Wed, 14 Oct 2020 12:08:36 +0000 (05:08 -0700)
commit9068711f210e02a2b80f46813e47f338718c94dc
treeb2a62b225ec9f6fb533a3c190a8dc0f8df03d1c1
parent252c9967ba785aedf3b39e2cd50237d0f32fe3bd
c++: Instantiation with local extern [PR97395]

It turns out that pushdecl_with_scope has somewhat strange behaviour,
which probably made more sense way back.  Unfortunately making it
somewhat saner turned into a rathole.  Instead use a
push_nested_namespace around pushing the alias -- this is similar to
some of the friend handling we already have.

gcc/cp/
* name-lookup.c (push_local_extern_decl_alias): Push into alias's
namespace and use pushdecl.
(do_pushdecl_with_scope): Clarify behaviour.
gcc/testsuite/
* g++.dg/lookup/extern-redecl2.C: New.
gcc/cp/name-lookup.c
gcc/testsuite/g++.dg/lookup/extern-redecl2.C [new file with mode: 0644]