From adaefe2a50b56505b9745955da5231cd87ce9d8a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20Dumont?= Date: Mon, 18 Dec 2017 21:59:17 +0000 Subject: [PATCH] re PR libstdc++/80761 (std::set::insert_return_type uses wrong iterator type) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 2017-11-20 François Dumont PR libstdc++/80761 * include/debug/map.h (std::__debug::map<>::insert_return_type): Define using _Node_insert_return. * include/debug/set.h (std::__debug::set<>::insert_return_type): Likewise. * include/debug/unordered_map: (std::__debug::unordered_map<>::insert_return_type): Likewise. * include/debug/unordered_set: (std::__debug::unordered_set<>::insert_return_type): Likewise. From-SVN: r255789 --- libstdc++-v3/ChangeLog | 13 +++++++++++++ libstdc++-v3/include/debug/map.h | 10 ++-------- libstdc++-v3/include/debug/set.h | 10 ++-------- libstdc++-v3/include/debug/unordered_map | 10 ++-------- libstdc++-v3/include/debug/unordered_set | 10 ++-------- 5 files changed, 21 insertions(+), 32 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 08096d10e7c..2a99643feec 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,16 @@ +2017-11-20 François Dumont + + PR libstdc++/80761 + * include/debug/map.h + (std::__debug::map<>::insert_return_type): Define using + _Node_insert_return. + * include/debug/set.h (std::__debug::set<>::insert_return_type): + Likewise. + * include/debug/unordered_map: + (std::__debug::unordered_map<>::insert_return_type): Likewise. + * include/debug/unordered_set: + (std::__debug::unordered_set<>::insert_return_type): Likewise. + 2017-12-18 Ville Voutilainen PR libstdc++/68430 diff --git a/libstdc++-v3/include/debug/map.h b/libstdc++-v3/include/debug/map.h index d5a2c9f6e6f..f769b501b58 100644 --- a/libstdc++-v3/include/debug/map.h +++ b/libstdc++-v3/include/debug/map.h @@ -401,13 +401,7 @@ namespace __debug #if __cplusplus > 201402L using node_type = typename _Base::node_type; - - struct insert_return_type - { - bool inserted; - iterator position; - node_type node; - }; + using insert_return_type = _Node_insert_return; node_type extract(const_iterator __position) @@ -431,7 +425,7 @@ namespace __debug { auto __ret = _Base::insert(std::move(__nh)); iterator __pos = iterator(__ret.position, this); - return { __ret.inserted, __pos, std::move(__ret.node) }; + return { __pos, __ret.inserted, std::move(__ret.node) }; } iterator diff --git a/libstdc++-v3/include/debug/set.h b/libstdc++-v3/include/debug/set.h index 5353cfe87b2..4466bfc98e8 100644 --- a/libstdc++-v3/include/debug/set.h +++ b/libstdc++-v3/include/debug/set.h @@ -298,13 +298,7 @@ namespace __debug #if __cplusplus > 201402L using node_type = typename _Base::node_type; - - struct insert_return_type - { - bool inserted; - iterator position; - node_type node; - }; + using insert_return_type = _Node_insert_return; node_type extract(const_iterator __position) @@ -328,7 +322,7 @@ namespace __debug { auto __ret = _Base::insert(std::move(__nh)); iterator __pos = iterator(__ret.position, this); - return { __ret.inserted, __pos, std::move(__ret.node) }; + return { __pos, __ret.inserted, std::move(__ret.node) }; } iterator diff --git a/libstdc++-v3/include/debug/unordered_map b/libstdc++-v3/include/debug/unordered_map index c68ccaa3372..0ed9922c5bf 100644 --- a/libstdc++-v3/include/debug/unordered_map +++ b/libstdc++-v3/include/debug/unordered_map @@ -462,13 +462,7 @@ namespace __debug #if __cplusplus > 201402L using node_type = typename _Base::node_type; - - struct insert_return_type - { - bool inserted; - iterator position; - node_type node; - }; + using insert_return_type = _Node_insert_return; node_type extract(const_iterator __position) @@ -499,7 +493,7 @@ namespace __debug { auto __ret = _Base::insert(std::move(__nh)); iterator __pos = iterator(__ret.position, this); - return { __ret.inserted, __pos, std::move(__ret.node) }; + return { __pos, __ret.inserted, std::move(__ret.node) }; } iterator diff --git a/libstdc++-v3/include/debug/unordered_set b/libstdc++-v3/include/debug/unordered_set index 1fe493fe52f..1f8e95f6c22 100644 --- a/libstdc++-v3/include/debug/unordered_set +++ b/libstdc++-v3/include/debug/unordered_set @@ -372,13 +372,7 @@ namespace __debug #if __cplusplus > 201402L using node_type = typename _Base::node_type; - - struct insert_return_type - { - bool inserted; - iterator position; - node_type node; - }; + using insert_return_type = _Node_insert_return; node_type extract(const_iterator __position) @@ -409,7 +403,7 @@ namespace __debug { auto __ret = _Base::insert(std::move(__nh)); iterator __pos = iterator(__ret.position, this); - return { __ret.inserted, __pos, std::move(__ret.node) }; + return { __pos, __ret.inserted, std::move(__ret.node) }; } iterator -- 2.30.2