Go to file
Jonathan Wakely aaeac1568d P0357R3 reference_wrapper for incomplete types
This patch implements the C++2a proposal to allow incomplete types in
std::reference_wrapper, which was previously undefined.

The change cannot be implemented for earlier standards, because prior to
C++2a std::reference_wrapper has a weak result type, so must inspect the
template argument to see if it defines a nested result_type member. That
is deprecated (but still required) in C++17, and removed from C++2a.

The removal of the base class from reference_wrapper is a potential ABI
change, as it could alter the layout of a type which derives from
reference_wrapper<T> and from an empty type with _Weak_result_type<T> as
a base class.  Previously the repeated _Weak_result_type<T> base class
would have prevented the empty base-class optimization, but if
reference_wrapper<T> no longer derives from it, the empty class could be
placed at the same address as the reference_wrapper<T> base.  In
practice, the only types which derive from _Weak_result_type or from
_Reference_wrapper_base_memfun or any of its base classes are non-empty
types defined in libstdc++: std::reference_wrapper, std::function, and
std::_Bind. As they are non-empty types, they are not eligible for EBO
anyway.

	* include/bits/refwrap.h [__cplusplus > 201703L]
	(_Refwrap_base_arg1, _Refwrap_base_arg2, _Reference_wrapper_base)
	(_Reference_wrapper_base_memfun): Do not define for C++2a.
	(reference_wrapper): Do not derive from _Reference_wrapper_base_memfun
	for C++2a.
	(reference_wrapper::operator()): Add static assertion.
	* testsuite/20_util/reference_wrapper/incomplete.cc: New test.

From-SVN: r267866
2019-01-11 23:41:11 +00:00
INSTALL
config iconv.m4 (AM_ICONV_LINK): Don't overwrite CPPFLAGS. 2018-11-07 15:41:21 -07:00
contrib PR other/16615 [1/5] 2019-01-09 16:37:45 -05:00
fixincludes Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
gcc re PR fortran/35031 (ELEMENTAL procedure with BIND(C)) 2019-01-11 23:41:04 +00:00
gnattools PR81878: fix --disable-bootstrap --enable-languages=ada 2018-11-20 00:07:47 +00:00
gotools Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
include PR other/16615 [2/5] 2019-01-09 16:39:49 -05:00
intl iconv.m4 (AM_ICONV_LINK): Don't overwrite CPPFLAGS. 2018-11-07 15:41:21 -07:00
libada Update copyright years. 2019-01-01 13:31:55 +01:00
libatomic Update copyright years. 2019-01-01 13:31:55 +01:00
libbacktrace PR other/16615 [1/5] 2019-01-09 16:37:45 -05:00
libcc1 Update copyright years. 2019-01-01 13:31:55 +01:00
libcpp Update copyright years. 2019-01-01 13:31:55 +01:00
libdecnumber Update copyright years. 2019-01-01 13:31:55 +01:00
libffi Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
libgcc PR other/16615 [1/5] 2019-01-09 16:37:45 -05:00
libgfortran PR other/16615 [1/5] 2019-01-09 16:37:45 -05:00
libgo runtime: in doscanstackswitch, set gp->m before gogo 2019-01-07 22:07:26 +00:00
libgomp Better distinguish OpenACC and OpenMP sections in libgomp.texi 2019-01-11 13:55:01 +00:00
libhsail-rt Update copyright years. 2019-01-01 13:31:55 +01:00
libiberty PR other/16615 [2/5] 2019-01-09 16:39:49 -05:00
libitm Update copyright years. 2019-01-01 13:31:55 +01:00
libobjc PR other/16615 [4/5] 2019-01-09 16:44:56 -05:00
liboffloadmic PR other/16615 [1/5] 2019-01-09 16:37:45 -05:00
libphobos libphobos: Merge phobos upstream b022e552a 2019-01-09 23:04:20 +00:00
libquadmath Update copyright years. 2019-01-01 13:31:55 +01:00
libsanitizer Cherry pick libsanitizer patch (https://reviews.llvm.org/D54856). 2018-12-27 09:47:20 +00:00
libssp Update copyright years. 2019-01-01 13:31:55 +01:00
libstdc++-v3 P0357R3 reference_wrapper for incomplete types 2019-01-11 23:41:11 +00:00
libvtv Update copyright years. 2019-01-01 13:31:55 +01:00
lto-plugin Update copyright years. 2019-01-01 13:31:55 +01:00
maintainer-scripts Add new maintainer script for PRs that can be closed. 2018-11-22 14:05:54 +00:00
zlib Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
ChangeLog Update config.guess, config.sub (PR target/88535) 2019-01-03 11:28:27 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
MAINTAINERS Update maintainer email address 2018-12-21 17:53:03 +00:00
Makefile.def Add D front-end, libphobos library, and D2 testsuite. 2018-10-28 19:51:47 +00:00
Makefile.in darwin - add configuration support for 'otool' 2018-12-05 21:57:00 +00:00
Makefile.tpl darwin - add configuration support for 'otool' 2018-12-05 21:57:00 +00:00
README
ar-lib Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
compile
config-ml.in Add D front-end, libphobos library, and D2 testsuite. 2018-10-28 19:51:47 +00:00
config.guess Update config.guess, config.sub (PR target/88535) 2019-01-03 11:28:27 +00:00
config.rpath
config.sub Update config.guess, config.sub (PR target/88535) 2019-01-03 11:28:27 +00:00
configure darwin - add configuration support for 'otool' 2018-12-05 21:57:00 +00:00
configure.ac darwin - add configuration support for 'otool' 2018-12-05 21:57:00 +00:00
depcomp
install-sh
libtool-ldflags
libtool.m4 Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
ltgcc.m4
ltmain.sh libtool.m4: Sort output of 'find' to enable deterministic builds. 2018-07-05 13:13:45 -06:00
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
missing
mkdep
mkinstalldirs
move-if-change
multilib.am Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
symlink-tree
test-driver Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
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.