Go to file
Jonathan Wakely 17bc3848e0 libstdc++: Implement LWG 2762 for std::unique_ptr::operator*
The LWG issue proposes to add a conditional noexcept-specifier to
std::unique_ptr's dereference operator. The issue is currently in
Tentatively Ready status, but even if it isn't voted into the draft, we
can do it as a conforming extensions. This commit also adds a similar
noexcept-specifier to operator[] for the unique_ptr<T[], D> partial
specialization.

Also ensure that all dereference operators for shared_ptr are noexcept,
and adds tests for the std::optional accessors modified by the issue,
which were already noexcept in our implementation.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	* include/bits/shared_ptr_base.h (__shared_ptr_access::operator[]):
	Add noexcept.
	* include/bits/unique_ptr.h (unique_ptr::operator*): Add
	conditional noexcept as per LWG 2762.
	* testsuite/20_util/shared_ptr/observers/array.cc: Check that
	dereferencing cannot throw.
	* testsuite/20_util/shared_ptr/observers/get.cc: Likewise.
	* testsuite/20_util/optional/observers/lwg2762.cc: New test.
	* testsuite/20_util/unique_ptr/lwg2762.cc: New test.
2021-06-24 14:04:02 +01:00
c++tools
config
contrib Daily bump. 2021-06-24 00:16:30 +00:00
fixincludes
gcc Emit .file 0 directive earlier in DWARF 5 2021-06-24 14:11:32 +02:00
gnattools
gotools
include
INSTALL
intl
libada
libatomic
libbacktrace
libcc1
libcody
libcpp Daily bump. 2021-06-17 00:16:54 +00:00
libdecnumber
libffi Daily bump. 2021-06-17 00:16:54 +00:00
libgcc Daily bump. 2021-06-24 00:16:30 +00:00
libgfortran Daily bump. 2021-06-23 00:16:28 +00:00
libgo
libgomp openmp: in_reduction clause support on target construct 2021-06-24 11:35:08 +02:00
libiberty
libitm Daily bump. 2021-06-18 00:16:58 +00:00
libobjc
liboffloadmic
libphobos
libquadmath
libsanitizer
libssp
libstdc++-v3 libstdc++: Implement LWG 2762 for std::unique_ptr::operator* 2021-06-24 14:04:02 +01:00
libvtv
lto-plugin
maintainer-scripts
zlib
.dir-locals.el
.gitattributes
.gitignore Add cscope.out to git ignore. 2021-06-24 16:51:40 +05:30
ABOUT-NLS
ar-lib
ChangeLog Daily bump. 2021-06-23 00:16:28 +00:00
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 Remove my Write After Approval entry. 2021-06-22 16:09:56 +08:00
Makefile.def
Makefile.in
Makefile.tpl
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
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.