aaeac1568d
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 |
||
---|---|---|
INSTALL | ||
config | ||
contrib | ||
fixincludes | ||
gcc | ||
gnattools | ||
gotools | ||
include | ||
intl | ||
libada | ||
libatomic | ||
libbacktrace | ||
libcc1 | ||
libcpp | ||
libdecnumber | ||
libffi | ||
libgcc | ||
libgfortran | ||
libgo | ||
libgomp | ||
libhsail-rt | ||
libiberty | ||
libitm | ||
libobjc | ||
liboffloadmic | ||
libphobos | ||
libquadmath | ||
libsanitizer | ||
libssp | ||
libstdc++-v3 | ||
libvtv | ||
lto-plugin | ||
maintainer-scripts | ||
zlib | ||
.dir-locals.el | ||
.gitattributes | ||
.gitignore | ||
ABOUT-NLS | ||
COPYING | ||
COPYING.LIB | ||
COPYING.RUNTIME | ||
COPYING3 | ||
COPYING3.LIB | ||
ChangeLog | ||
ChangeLog.jit | ||
ChangeLog.tree-ssa | ||
MAINTAINERS | ||
Makefile.def | ||
Makefile.in | ||
Makefile.tpl | ||
README | ||
ar-lib | ||
compile | ||
config-ml.in | ||
config.guess | ||
config.rpath | ||
config.sub | ||
configure | ||
configure.ac | ||
depcomp | ||
install-sh | ||
libtool-ldflags | ||
libtool.m4 | ||
ltgcc.m4 | ||
ltmain.sh | ||
ltoptions.m4 | ||
ltsugar.m4 | ||
ltversion.m4 | ||
lt~obsolete.m4 | ||
missing | ||
mkdep | ||
mkinstalldirs | ||
move-if-change | ||
multilib.am | ||
symlink-tree | ||
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.