Go to file
Patrick Palka 22b20ac6c6 c++/modules: imported spec befriending class tmpl [PR114889]
When adding to CLASSTYPE_BEFRIENDING_CLASSES as part of installing an
imported class definition, we need to look through TEMPLATE_DECL like
make_friend_class does.

Otherwise in the below testcase we won't add _Hashtable<int, int> to
CLASSTYPE_BEFRIENDING_CLASSES of _Map_base, which leads to a bogus
access check failure for _M_hash_code.

	PR c++/114889

gcc/cp/ChangeLog:

	* module.cc (trees_in::read_class_def): Look through
	TEMPLATE_DECL when adding to CLASSTYPE_BEFRIENDING_CLASSES.

gcc/testsuite/ChangeLog:

	* g++.dg/modules/friend-8_a.H: New test.
	* g++.dg/modules/friend-8_b.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
2024-04-29 21:27:59 -04:00
.github
c++tools
config
contrib Daily bump. 2024-04-27 00:18:05 +00:00
fixincludes
gcc c++/modules: imported spec befriending class tmpl [PR114889] 2024-04-29 21:27:59 -04:00
gnattools
gotools
include
INSTALL
libada
libatomic Daily bump. 2024-04-27 00:18:05 +00:00
libbacktrace Daily bump. 2024-04-29 00:17:54 +00:00
libcc1
libcody
libcpp
libdecnumber
libffi
libgcc Daily bump. 2024-04-26 00:16:42 +00:00
libgfortran Daily bump. 2024-04-30 00:17:28 +00:00
libgm2
libgo runtime: dump registers on Solaris 2024-04-29 11:39:58 -07:00
libgomp Daily bump. 2024-04-27 00:18:05 +00:00
libgrust
libiberty
libitm
libobjc
libphobos
libquadmath
libsanitizer
libssp
libstdc++-v3 Daily bump. 2024-04-30 00:17:28 +00:00
libvtv
lto-plugin
maintainer-scripts Daily bump. 2024-04-27 00:18:05 +00:00
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
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.RUNTIME
depcomp
install-sh
libtool-ldflags
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.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.