c++: block-scope extern decl with default args
authorNathan Sidwell <nathan@acm.org>
Tue, 20 Oct 2020 19:17:21 +0000 (12:17 -0700)
committerNathan Sidwell <nathan@acm.org>
Tue, 20 Oct 2020 19:20:10 +0000 (12:20 -0700)
commit15b8e2af42168a41636186c53d1e833302195601
treeafbc7517b3692877b3cda065eb72f1be29f45702
parentd962ef77dadea87b2bf30487bddda00c350bf0ba
c++: block-scope extern decl with default args

In adding the DECL_LOCAL_DECL handling, I'd forgotten that the
parm-decls also need cloning -- and resetting of their DECL_CONTEXT.
Also, any default args need droping when adding an alias, as those are
not propagated.  The std's not totally clear on this latter point when
there's no exising namespace decl, but that seems like the right thing
and is what clang does.

gcc/cp/
* name-lookup.c (push_local_extern_decl_alias): Reconstextualize
alias' parm decls.  Drop any default args.
gcc/testsuite/
* g++.dg/lookup/local-extern.C: New.
gcc/cp/name-lookup.c
gcc/testsuite/g++.dg/lookup/local-extern.C [new file with mode: 0644]