[committed] libstdc++: Simplify noexcept-specifiers for move constructors

Jonathan Wakely jwakely@redhat.com
Fri Apr 9 12:06:44 GMT 2021


On 08/04/21 17:50 +0100, Jonathan Wakely wrote:
>This puts the logic for the noexcept-specifier in one place, and then
>reuses it elsewhere. This means checking whether the move constructor
>can throw doesn't need to do overload resolution and then check whether
>some other constructor can throw, we just get the answer directly.
>
>libstdc++-v3/ChangeLog:
>
>	* include/bits/hashtable.h (_Hashtable::_S_nothrow_move()):
>	New function to determine noexcept-specifier for move
>	constructors.
>	(_Hashtable): Use _S_nothrow_move() on move constructors.
>	* testsuite/23_containers/unordered_map/cons/noexcept_move_construct.cc:
>	Correct static assertion message.
>	* testsuite/23_containers/unordered_multimap/cons/noexcept_move_construct.cc:
>	Likewise.
>	* testsuite/23_containers/unordered_multiset/cons/noexcept_move_construct.cc:
>	Likewise.
>	* testsuite/23_containers/unordered_set/cons/noexcept_move_construct.cc:
>	Likewise.
>

I keep forgetting that a constexpr function in C++11 has to be a single
return statement.

I'm testing this patch now and will push to trunk and backport to the
branches where I already backported the breakage (facepalm).


-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 3307 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20210409/2534129f/attachment.bin>


More information about the Libstdc++ mailing list