[Bug libstdc++/96029] [8/9 Regression] Inconsistencies with associative/unordered containers

2021-04-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96029

--- Comment #7 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Jonathan Wakely
:

https://gcc.gnu.org/g:5f63261c3e54995b45dd411ad76526870c4b8be3

commit r9-9328-g5f63261c3e54995b45dd411ad76526870c4b8be3
Author: François Dumont 
Date:   Mon Jan 20 19:15:43 2020 +0100

libstdc++: Fix unordered containers move constructors noexcept
qualification

_Hashtable move constructor is wrongly qualified as noexcept(true)
regardless of
_Equal and _H1 copy constructor qualifications.
_Hashtable allocator-aware move constructor is missing its noexcept
qualification like the depending unordered containers ones.

This backport also includes the changes from r11-8062 and r11-2438.

libstdc++-v3/ChangeLog:

PR libstdc++/96029
* include/bits/hashtable.h
(_Hashtable(_Hashtable&& __ht, __node_alloc_type&& __a,
true_type)):
Add noexcept qualification.
(_Hashtable(_Hashtable&&)): Fix noexcept qualification.
(_Hashtable(_Hashtable&&, const allocator_type&)): Add noexcept
qualification.
* include/bits/unordered_map.h
(unordered_map(unordered_map&&, const allocator_type&)): Add
noexcept
qualification.
(unordered_multimap(unordered_multimap&&, const allocator_type&)):
Likewise.
* include/bits/unordered_set.h
(unordered_set(unordered_set&&, const allocator_type&)): Likewise.
(unordered_multiset(unordered_multiset&&, const allocator_type&)):
Likewise.
* include/debug/unordered_map
(unordered_map(unordered_map&&, const allocator_type&)): Likewise.
(unordered_multimap(unordered_multimap&&, const allocator_type&)):
Likewise.
* include/debug/unordered_set
(unordered_set(unordered_set&&, const allocator_type&)): Likewise.
(unordered_multiset(unordered_multiset&&, const allocator_type&)):
Likewise.
* testsuite/23_containers/unordered_map/allocator/default_init.cc:
New test.
*
testsuite/23_containers/unordered_map/cons/noexcept_default_construct.cc:
New test.
*
testsuite/23_containers/unordered_map/cons/noexcept_move_construct.cc:
New test.
* testsuite/23_containers/unordered_map/modifiers/move_assign.cc:
New test.
*
testsuite/23_containers/unordered_multimap/cons/noexcept_default_construct.cc:
New test.
*
testsuite/23_containers/unordered_multimap/cons/noexcept_move_construct.cc:
New test.
*
testsuite/23_containers/unordered_multiset/cons/noexcept_default_construct.cc:
New test.
*
testsuite/23_containers/unordered_multiset/cons/noexcept_move_construct.cc:
New test.
* testsuite/23_containers/unordered_set/allocator/default_init.cc:
New test.
*
testsuite/23_containers/unordered_set/cons/noexcept_default_construct.cc:
New test.
*
testsuite/23_containers/unordered_set/cons/noexcept_move_construct.cc:
New test.

(cherry picked from commit 12324b9a934654a5c3bf4a614853ded2e0a958af)

[Bug libstdc++/96029] [8/9 Regression] Inconsistencies with associative/unordered containers

2021-04-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96029

--- Comment #6 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Jonathan Wakely
:

https://gcc.gnu.org/g:1228154b8726a3bc903f1967f9b3aac8fd192e46

commit r9-9327-g1228154b8726a3bc903f1967f9b3aac8fd192e46
Author: François Dumont 
Date:   Fri Jul 3 08:13:19 2020 +0200

libstdc++: Fix [multi]map/[multi]set move constructors noexcept
qualification

Container move constructors shall not consider their allocator move
constructor qualification.

For the backport to gcc-9 the _Rb_tree_impl move constructor must be
user-provided, because prior to the implementation of P1286R2 in
r10-4094, a defaulted special member with a different exception would be
deleted.

libstdc++-v3/ChangeLog:

PR libstdc++/96029
* include/bits/stl_tree.h (_Rb_tree_impl(_Rb_tree_impl&&)): Add
noexcept
qualification based only on _Compare one.
* testsuite/23_containers/map/cons/noexcept_move_construct.cc: Add
static asserts.
* testsuite/23_containers/multimap/cons/noexcept_move_construct.cc:
Likewise.
* testsuite/23_containers/multiset/cons/noexcept_move_construct.cc:
Likewise.
* testsuite/23_containers/set/cons/noexcept_move_construct.cc:
Likewise.

(cherry picked from commit c832cf1c1d114aed70c2f84566cf4d63de0a56d0)

[Bug libstdc++/96029] [8/9 Regression] Inconsistencies with associative/unordered containers

2021-04-08 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96029

Jonathan Wakely  changed:

   What|Removed |Added

Summary|[8/9/10 Regression] |[8/9 Regression]
   |Inconsistencies with|Inconsistencies with
   |associative/unordered   |associative/unordered
   |containers  |containers

--- Comment #5 from Jonathan Wakely  ---
Fixed for 10.4 too.