Go to file
Nathaniel Shead 515045254f c++/modules: Import purview using-directives in the same module [PR122279]
[namespace.qual] p1 says that a namespace nominated by a using-directive
is searched if the using-directive precedes that point.

[basic.lookup.general] p2 says that a declaration in a different TU
within a module purview is visible if either the declaration is
exported, or the other TU is part of the same module as the point of
lookup.  This patch implements the second half of that.

	PR c++/122279

gcc/cp/ChangeLog:

	* module.cc (depset:#️⃣:add_namespace_entities): Seed any
	purview using-decls.
	(module_state::write_using_directives): Stream if the udir was
	exported or not.
	(module_state::read_using_directives): Add the using-directive
	if it's either exported or part of this module.

gcc/testsuite/ChangeLog:

	* g++.dg/modules/namespace-13_b.C: Adjust expected results.
	* g++.dg/modules/namespace-13_c.C: Test non-exported
	using-directive is not used.
	* g++.dg/modules/namespace-14_a.C: New test.
	* g++.dg/modules/namespace-14_b.C: New test.
	* g++.dg/modules/namespace-14_c.C: New test.
	* g++.dg/modules/namespace-14_d.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Patrick Palka <ppalka@redhat.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
2025-10-19 00:53:31 +11:00
.forgejo
.github
INSTALL
c++tools
config Daily bump. 2025-10-05 16:50:51 +00:00
contrib Daily bump. 2025-10-17 00:18:48 +00:00
fixincludes
gcc c++/modules: Import purview using-directives in the same module [PR122279] 2025-10-19 00:53:31 +11:00
gnattools
gotools
include Daily bump. 2025-10-17 00:18:48 +00:00
libada
libatomic Daily bump. 2025-10-10 00:21:51 +00:00
libbacktrace Daily bump. 2025-10-05 16:50:51 +00:00
libcc1 Daily bump. 2025-10-10 00:21:51 +00:00
libcody
libcpp Daily bump. 2025-10-14 00:20:06 +00:00
libdecnumber
libffi Daily bump. 2025-10-05 16:50:51 +00:00
libgcc Daily bump. 2025-10-10 00:21:51 +00:00
libgcobol Daily bump. 2025-10-11 00:21:09 +00:00
libgfortran Daily bump. 2025-10-05 16:50:51 +00:00
libgm2 Daily bump. 2025-10-08 00:20:55 +00:00
libgo
libgomp Daily bump. 2025-10-17 00:18:48 +00:00
libgrust Daily bump. 2025-10-05 16:50:51 +00:00
libiberty Daily bump. 2025-10-05 16:50:51 +00:00
libitm Daily bump. 2025-10-05 16:50:51 +00:00
libobjc Daily bump. 2025-10-05 16:50:51 +00:00
libphobos Daily bump. 2025-10-05 16:50:51 +00:00
libquadmath Daily bump. 2025-10-05 16:50:51 +00:00
libsanitizer Daily bump. 2025-10-05 16:50:51 +00:00
libssp Daily bump. 2025-10-05 16:50:51 +00:00
libstdc++-v3 Daily bump. 2025-10-18 00:18:06 +00:00
libvtv Daily bump. 2025-10-05 16:50:51 +00:00
lto-plugin Daily bump. 2025-10-05 16:50:51 +00:00
maintainer-scripts
zlib Daily bump. 2025-10-05 16:50:51 +00:00
.b4-config
.dir-locals.el
.editorconfig toplevel: unify the GCC and GDB/binutils .editorconfig files 2025-10-01 15:42:59 +01:00
.gitattributes
.gitignore
ABOUT-NLS
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB COPYING_v3: New file. 2007-07-17 08:37:53 +00:00
ChangeLog Daily bump. 2025-10-16 00:21:56 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
MAINTAINERS
Makefile.def PR81358: Enable automatic linking of libatomic. 2025-10-09 07:26:51 +00:00
Makefile.in [PATCH] Makefile.tpl: remove an extra \; from find command 2025-10-15 11:32:21 -06:00
Makefile.tpl [PATCH] Makefile.tpl: remove an extra \; from find command 2025-10-15 11:32:21 -06:00
README
SECURITY.txt
ar-lib
compile
config-ml.in *: Fix patch email address 2025-10-11 11:08:01 +02:00
config.guess
config.rpath
config.sub
configure PR81358: Enable automatic linking of libatomic. 2025-10-09 07:26:51 +00:00
configure.ac PR81358: Enable automatic linking of libatomic. 2025-10-09 07:26:51 +00:00
depcomp
install-sh
libtool-ldflags
libtool.m4 Sync toplevel files from binutils-gdb 2025-10-02 15:00:06 +08:00
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
symlink-tree *: Fix patch email address 2025-10-11 11:08:01 +02:00
test-driver
ylwrap

README

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.