gcc/libstdc++-v3
Jonathan Wakely ce9f305e44 Add __is_nothrow_convertible to fix std::is_nothrow_invocable_r
The definition of is_nothrow_invocable in terms of is_convertible and
is_nothrow_constructible is incorrect, because a type could have an
explicit constructor that means is_nothrow_constructible is true, but
implicit conversions could use a different constructor that is
potentially-throwing.

Fix it by adding a C++11 version of C++20's is_nothrow_convertible that
only considers implicit conversions.

	* include/std/type_traits (__is_nt_convertible_helper): Define it
	unconditionally, not only for C++20.
	(__is_nothrow_convertible): Define internal trait for use in C++11.
	(__is_nt_invocable_impl: Fix by using __is_nothrow_convertible.
	(is_invocable_r_v, is_nothrow_invocable_r_v): Add missing parameter.
	* testsuite/20_util/is_nothrow_convertible/value_ext.cc: New test.
	* testsuite/20_util/is_nothrow_convertible/value.cc: Check with type
	that has nothrow explicit conversion but potentially-throwing implicit
	conversion.
	* testsuite/20_util/is_nothrow_invocable/value.cc: Likewise.
	* testsuite/20_util/is_nothrow_invocable/value_ext.cc: Fix helper
	function to only consider implicit conversions.
	* testsuite/20_util/tuple/cons/noexcept_specs.cc: Add comment.

From-SVN: r271171
2019-05-14 15:39:58 +01:00
..
config Improve API docs for <memory> and <scoped_allocator> 2019-05-02 16:45:04 +01:00
doc Small markup changes to PBDS docs 2019-05-13 21:11:47 +01:00
include Add __is_nothrow_convertible to fix std::is_nothrow_invocable_r 2019-05-14 15:39:58 +01:00
libsupc++ Improve API docs for <memory> and <new> 2019-05-10 22:41:11 +01:00
po
python Fix unique_ptr pretty printer for empty classes 2019-05-14 12:17:18 +01:00
scripts Remove Profile Mode, deprecated since GCC 7.1 2019-05-13 11:50:21 +01:00
src PR libstdc++/90299 make filesystem::absolute overloads consistent 2019-05-04 15:35:33 +01:00
testsuite Add __is_nothrow_convertible to fix std::is_nothrow_invocable_r 2019-05-14 15:39:58 +01:00
acinclude.m4
aclocal.m4
ChangeLog Add __is_nothrow_convertible to fix std::is_nothrow_invocable_r 2019-05-14 15:39:58 +01:00
ChangeLog-1998
ChangeLog-1999
ChangeLog-2000
ChangeLog-2001
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
config.h.in
configure
configure.ac
configure.host
crossconfig.m4
fragment.am
linkage.m4
Makefile.am
Makefile.in
README

file: libstdc++-v3/README

New users may wish to point their web browsers to the file
index.html in the 'doc/html' subdirectory.  It contains brief
building instructions and notes on how to configure the library in
interesting ways.