b334182653
This attempts to make is_nothrow_constructible more robust (and efficient to compile) by not depending on is_constructible. Instead the __is_constructible intrinsic is used directly. The helper class __is_nt_constructible_impl which checks whether the construction is non-throwing now takes a bool template parameter that is substituted by the result of the instrinsic. This fixes the reported bug by not using the already-instantiated (and incorrect) value of std::is_constructible. I don't think it really fixes the problem in general, because std::is_nothrow_constructible itself could already have been instantiated in a context where it gives the wrong result. A proper fix needs to be done in the compiler. PR libstdc++/94033 * include/std/type_traits (__is_nt_default_constructible_atom): Remove. (__is_nt_default_constructible_impl): Remove. (__is_nothrow_default_constructible_impl): Remove. (__is_nt_constructible_impl): Add bool template parameter. Adjust partial specializations. (__is_nothrow_constructible_impl): Replace class template with alias template. (is_nothrow_default_constructible): Derive from alias template __is_nothrow_constructible_impl instead of __is_nothrow_default_constructible_impl. * testsuite/20_util/is_nothrow_constructible/94003.cc: New test. |
||
---|---|---|
.. | ||
algorithm | ||
any | ||
array | ||
atomic | ||
bit | ||
bitset | ||
charconv | ||
chrono | ||
codecvt | ||
complex | ||
concepts | ||
condition_variable | ||
coroutine | ||
deque | ||
execution | ||
filesystem | ||
forward_list | ||
fstream | ||
functional | ||
future | ||
iomanip | ||
ios | ||
iosfwd | ||
iostream | ||
istream | ||
iterator | ||
limits | ||
list | ||
locale | ||
map | ||
memory | ||
memory_resource | ||
mutex | ||
numbers | ||
numeric | ||
optional | ||
ostream | ||
queue | ||
random | ||
ranges | ||
ratio | ||
regex | ||
scoped_allocator | ||
set | ||
shared_mutex | ||
span | ||
sstream | ||
stack | ||
stdexcept | ||
stop_token | ||
streambuf | ||
string | ||
string_view | ||
system_error | ||
thread | ||
tuple | ||
type_traits | ||
typeindex | ||
unordered_map | ||
unordered_set | ||
utility | ||
valarray | ||
variant | ||
vector | ||
version |