GCC modified for the FreeChainXenon project
![]() Currently, importing a namespace declarations marks it as imported, and so marks it as originating from the module that it was imported from. This is usually harmless, but causes problems with nested namespaces. In the linked PR, what happens is that the namespace 'A' imported from the module ends up not being considered when creating the 'A' namespace within its own TU, and thus it has its 'cp_binding_level' recreated. However, by this point 'A::B' has already been imported, and so the 'level_chain' member no longer correctly points at 'A's binding level, so the sanity check for this in 'resume_scope' ICEs. Since as far as I can tell there's no reason for imported namespaces to be attached to any specific module (namespace declarations with external linkage are always attached to the global module by [module.unit] p7.2), this patch just removes the 'imported' flag, which stops code from caring about its originating module. This patch also makes some minor adjustments to existing tests to cater for the new dumped name. PR c++/100707 gcc/cp/ChangeLog: * name-lookup.cc (add_imported_namespace): Don't mark namespaces as imported. gcc/testsuite/ChangeLog: * g++.dg/modules/indirect-1_b.C: Adjust to handle namespaces not being attached to the module they were imported from. * g++.dg/modules/indirect-1_c.C: Likewise. * g++.dg/modules/indirect-2_b.C: Likewise. * g++.dg/modules/indirect-2_c.C: Likewise. * g++.dg/modules/indirect-3_b.C: Likewise. * g++.dg/modules/indirect-3_c.C: Likewise. * g++.dg/modules/indirect-4_b.C: Likewise. * g++.dg/modules/indirect-4_c.C: Likewise. * g++.dg/modules/namespace-5_a.C: New test. * g++.dg/modules/namespace-5_b.C: New test. * g++.dg/modules/namespace-5_c.C: New test. Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com> |
||
---|---|---|
.github | ||
c++tools | ||
config | ||
contrib | ||
fixincludes | ||
gcc | ||
gnattools | ||
gotools | ||
include | ||
INSTALL | ||
libada | ||
libatomic | ||
libbacktrace | ||
libcc1 | ||
libcody | ||
libcpp | ||
libdecnumber | ||
libffi | ||
libgcc | ||
libgfortran | ||
libgm2 | ||
libgo | ||
libgomp | ||
libgrust | ||
libiberty | ||
libitm | ||
libobjc | ||
libphobos | ||
libquadmath | ||
libsanitizer | ||
libssp | ||
libstdc++-v3 | ||
libvtv | ||
lto-plugin | ||
maintainer-scripts | ||
zlib | ||
.dir-locals.el | ||
.gitattributes | ||
.gitignore | ||
ABOUT-NLS | ||
ar-lib | ||
ChangeLog | ||
ChangeLog.jit | ||
ChangeLog.tree-ssa | ||
compile | ||
config-ml.in | ||
config.guess | ||
config.rpath | ||
config.sub | ||
configure | ||
configure.ac | ||
COPYING | ||
COPYING.LIB | ||
COPYING.RUNTIME | ||
COPYING3 | ||
COPYING3.LIB | ||
depcomp | ||
install-sh | ||
libtool-ldflags | ||
libtool.m4 | ||
ltgcc.m4 | ||
ltmain.sh | ||
ltoptions.m4 | ||
ltsugar.m4 | ||
ltversion.m4 | ||
lt~obsolete.m4 | ||
MAINTAINERS | ||
Makefile.def | ||
Makefile.in | ||
Makefile.tpl | ||
missing | ||
mkdep | ||
mkinstalldirs | ||
move-if-change | ||
multilib.am | ||
README | ||
SECURITY.txt | ||
symlink-tree | ||
test-driver | ||
ylwrap |
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.