]> gcc.gnu.org Git - gcc.git/commit
c++: namespace reachability [PR 99344]
authorNathan Sidwell <nathan@acm.org>
Fri, 26 Feb 2021 15:51:13 +0000 (07:51 -0800)
committerNathan Sidwell <nathan@acm.org>
Wed, 3 Mar 2021 12:23:08 +0000 (04:23 -0800)
commit8c4f0c0ceb346e7deb69a44688faab6103aa57da
tree4db3f0b423cdf15b7626c31a68bfff30d1ddc10a
parenta7267237371cc978fa6e0485446af11c60e4b102
c++: namespace reachability [PR 99344]

This reworks namespace serializing to avoid some issues I ran into
when working on 99170.  In modules, (non-anonymous) namespaces are
strange beasts, that always have external linkage, but may have
module-specific visibility.  I still don't get the latter 100%
correct, but this is in the right direction.

PR c++/99344
gcc/cp/
* module.cc (trees_out::decl_node): Small refactor.
(depset::hash::add_binding_entity): Return true on meeting an
import.  Set namespace's import here.
(module_state:write_namespaces): Inform of purview too.
(module_state:read_namespaces): Adjust.
* name-lookup.c (implicitly_export_namespace): Delete.
(do_pushdecl): Don't call it.
(push_namespace): Likewise, set purview.
(add_imported_namespace): Reorder parms.
* name-lookup.h (add_imported_namespace): Alter param ordering.
gcc/testsuite/
* g++.dg/modules/namespace-2_a.C
* g++.dg/modules/pr99344_a.C
* g++.dg/modules/pr99344_b.C
gcc/cp/module.cc
gcc/cp/name-lookup.c
gcc/cp/name-lookup.h
gcc/testsuite/g++.dg/modules/namespace-2_a.C
gcc/testsuite/g++.dg/modules/pr99344_a.C [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/pr99344_b.C [new file with mode: 0644]
This page took 0.065152 seconds and 5 git commands to generate.