From patchwork Sat Nov 13 13:17:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Fran=C3=A7ois_Dumont?= X-Patchwork-Id: 47609 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 356B53857C56 for ; Sat, 13 Nov 2021 13:18:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 356B53857C56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1636809502; bh=fneO4w8o3GeWymUu+YguXO5HRKBeu24HVOUZxJ1s2zc=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=Q44Zi1LO6Ez0LRqGtz3poukRxSy+ETf+KxeswBswbCI60SVm9Uxvw3fxnfAKpW/Ww 90565iLyTw1prYzzEdjPji/tzk3SP40EwptijfNiMmGKfc2r8rfdsrEsV/wFHFA4ZJ M51dbw+I7a91F8Pm8b2bZXuV2u9/0gOZjLOd7Re4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id DC48B3858403; Sat, 13 Nov 2021 13:17:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DC48B3858403 Received: by mail-wm1-x32f.google.com with SMTP id f7-20020a1c1f07000000b0032ee11917ceso8827063wmf.0; Sat, 13 Nov 2021 05:17:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-language; bh=fneO4w8o3GeWymUu+YguXO5HRKBeu24HVOUZxJ1s2zc=; b=P9LBlmSXIaXay/6XXJulrXEdxCZeCFnOpLFuPXu8++liO4Fym4MRJ5u9VX1UV0CHQA CQxWcD8DqxqWJaOLCQpUOnuuKQFhsZrCL1mlsiYYBONgHRXCl6ll7qAufzGprTBCldbo CJOHSoCJNrQMKs2pT9u+yJx10t9/oaNlG7X4W64wPUKRZ/Y+hPqe3jaqKsv2xTcvmzHU /XZPywFQsiG2dks19fqGQABVuFwI2Is/RESgXBk1aFf9GNdewi3tDPD6XCMRfLdniuqW f7jiATWLrco6OKipf+oHRZ9HT5NDsbaomjwylTxEZMd6JHV9EoM5LRgX6/IXHMVOyFWY 8law== X-Gm-Message-State: AOAM531hcWtDU9xc4bg1St/jlwjdaoRTOc6MvfkDv7J37TLQGBFfYvqB sirWgse6xuVMwLQa/nDwn+mi4x1VytE= X-Google-Smtp-Source: ABdhPJx+8EB1Epw0ioCdGd+vGJgbQj7Os204jDQSpmB2pb1stWLbZ2HQd5Emp2UHsNZFvCuxwFXV/g== X-Received: by 2002:a7b:c388:: with SMTP id s8mr42878639wmj.170.1636809469633; Sat, 13 Nov 2021 05:17:49 -0800 (PST) Received: from ?IPv6:2a01:e0a:1dc:b1c0:b8bf:a470:fe5:b06f? ([2a01:e0a:1dc:b1c0:b8bf:a470:fe5:b06f]) by smtp.googlemail.com with ESMTPSA id n13sm8616221wrt.44.2021.11.13.05.17.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 13 Nov 2021 05:17:48 -0800 (PST) To: "libstdc++@gcc.gnu.org" Subject: [PATCH][_GLIBCXX_DEBUG] Code cleanup/simplification Message-ID: <8c49ed0b-6c4f-7663-47a9-7c7f31b47c04@gmail.com> Date: Sat, 13 Nov 2021 14:17:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 Content-Language: fr X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Fran=C3=A7ois_Dumont_via_Gcc-patches?= From: =?utf-8?q?Fran=C3=A7ois_Dumont?= Reply-To: =?utf-8?q?Fran=C3=A7ois_Dumont?= Cc: gcc-patches Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" libstdc++: [_GLIBCXX_DEBUG] Remove _Safe_container<>::_M_safe()     Container code cleanup to get rid of _Safe_container<>::_M_safe() and just     _Safe:: calls which use normal inheritance. Also remove several usages of _M_base()     which can be most of the time ommitted and sometimes replace with explicit _Base::     calls.     libstdc++-v3/ChangeLog:             * include/debug/safe_container.h (_Safe_container<>::_M_safe): Remove.             * include/debug/deque (deque::operator=(initializer_list<>)): Replace             _M_base() call with _Base:: call.             (deque::operator[](size_type)): Likewise.             * include/debug/forward_list (forward_list(forward_list&&, const allocator_type&):             Remove _M_safe() and _M_base() calls.             (forward_list::operator=(initializer_list<>)): Remove _M_base() calls.             (forward_list::splice_after, forward_list::merge): Likewise.             * include/debug/list (list(list&&, const allocator_type&)):             Remove _M_safe() and _M_base() calls.             (list::operator=(initializer_list<>)): Remove _M_base() calls.             (list::splice, list::merge): Likewise.             * include/debug/map.h (map(map&&, const allocator_type&)):             Remove _M_safe() and _M_base() calls.             (map::operator=(initializer_list<>)): Remove _M_base() calls.             * include/debug/multimap.h (multimap(multimap&&, const allocator_type&)):             Remove _M_safe() and _M_base() calls.             (multimap::operator=(initializer_list<>)): Remove _M_base() calls.             * include/debug/set.h (set(set&&, const allocator_type&)):             Remove _M_safe() and _M_base() calls.             (set::operator=(initializer_list<>)): Remove _M_base() calls.             * include/debug/multiset.h (multiset(multiset&&, const allocator_type&)):             Remove _M_safe() and _M_base() calls.             (multiset::operator=(initializer_list<>)): Remove _M_base() calls.             * include/debug/string (basic_string(basic_string&&, const allocator_type&)):             Remove _M_safe() and _M_base() calls.             (basic_string::operator=(initializer_list<>)): Remove _M_base() call.             (basic_string::operator=(const _CharT*), basic_string::operator=(_CharT)): Likewise.             (basic_string::operator[](size_type), basic_string::operator+=(const basic_string&)): Likewise.             (basic_string::operator+=(const _Char*), basic_string::operator+=(_CharT)): Likewise.             * include/debug/unordered_map (unordered_map(unordered_map&&, const allocator_type&)):             Remove _M_safe() and _M_base() calls.             (unordered_map::operator=(initializer_list<>), unordered_map::merge): Remove _M_base() calls.             (unordered_multimap(unordered_multimap&&, const allocator_type&)):             Remove _M_safe() and _M_base() calls. (unordered_multimap::operator=(initializer_list<>), unordered_multimap::merge):             Remove _M_base() calls.             * include/debug/unordered_set (unordered_set(unordered_set&&, const allocator_type&)):             Remove _M_safe() and _M_base() calls.             (unordered_set::operator=(initializer_list<>), unordered_set::merge): Remove _M_base() calls.             (unordered_multiset(unordered_multiset&&, const allocator_type&)):             Remove _M_safe() and _M_base() calls. (unordered_multiset::operator=(initializer_list<>), unordered_multiset::merge):             Remove _M_base() calls.             * include/debug/vector (vector(vector&&, const allocator_type&):             Remove _M_safe() and _M_base() calls.             (vector::operator=(initializer_list<>)): Remove _M_base() calls.             (vector::operator[](size_type)): Likewise. Tested under Linux x86_64 _GLIBCXX_DEBUG mode -std=gnu++14 and -std=gnu++98. Ok to commit ? François diff --git a/libstdc++-v3/include/debug/deque b/libstdc++-v3/include/debug/deque index 52778ba1617..a73d6c34209 100644 --- a/libstdc++-v3/include/debug/deque +++ b/libstdc++-v3/include/debug/deque @@ -166,7 +166,7 @@ namespace __debug deque& operator=(initializer_list __l) { - _M_base() = __l; + _Base::operator=(__l); this->_M_invalidate_all(); return *this; } @@ -344,7 +344,7 @@ namespace __debug operator[](size_type __n) _GLIBCXX_NOEXCEPT { __glibcxx_check_subscript(__n); - return _M_base()[__n]; + return _Base::operator[](__n); } _GLIBCXX_NODISCARD @@ -352,7 +352,7 @@ namespace __debug operator[](size_type __n) const _GLIBCXX_NOEXCEPT { __glibcxx_check_subscript(__n); - return _M_base()[__n]; + return _Base::operator[](__n); } using _Base::at; diff --git a/libstdc++-v3/include/debug/forward_list b/libstdc++-v3/include/debug/forward_list index cae5b5f038b..6ed4853af40 100644 --- a/libstdc++-v3/include/debug/forward_list +++ b/libstdc++-v3/include/debug/forward_list @@ -242,8 +242,8 @@ namespace __debug noexcept( std::is_nothrow_constructible<_Base, _Base, const allocator_type&>::value ) - : _Safe(std::move(__list._M_safe()), __al), - _Base(std::move(__list._M_base()), __al) + : _Safe(std::move(__list), __al), + _Base(std::move(__list), __al) { } explicit @@ -287,7 +287,7 @@ namespace __debug forward_list& operator=(std::initializer_list<_Tp> __il) { - _M_base() = __il; + _Base::operator=(__il); this->_M_invalidate_all(); return *this; } @@ -584,7 +584,7 @@ namespace __debug return __it != __list._M_base().cbefore_begin() && __it != __list._M_base().end(); }); - _Base::splice_after(__pos.base(), std::move(__list._M_base())); + _Base::splice_after(__pos.base(), std::move(__list)); } void @@ -613,8 +613,7 @@ namespace __debug _Base_const_iterator __next = std::next(__i.base()); this->_M_transfer_from_if(__list, [__next](_Base_const_iterator __it) { return __it == __next; }); - _Base::splice_after(__pos.base(), std::move(__list._M_base()), - __i.base()); + _Base::splice_after(__pos.base(), std::move(__list), __i.base()); } void @@ -669,7 +668,7 @@ namespace __debug { return __it == __tmp; }); } - _Base::splice_after(__pos.base(), std::move(__list._M_base()), + _Base::splice_after(__pos.base(), std::move(__list), __before.base(), __last.base()); } @@ -710,7 +709,7 @@ namespace __debug this->_M_invalidate_if([__next](_Base_const_iterator __it) { return __it == __next; }); __to_destroy.splice_after(__to_destroy.cbefore_begin(), - _M_base(), __old); + *this, __old); __x = __old; _GLIBCXX20_ONLY( __removed++ ); } @@ -739,7 +738,7 @@ namespace __debug this->_M_invalidate_if([__x](_Base_const_iterator __it) { return __it == __x; }); __to_destroy.splice_after(__to_destroy.cbefore_begin(), - _M_base(), __old); + *this, __old); __x = __old; _GLIBCXX20_ONLY( __removed++ ); } @@ -777,7 +776,7 @@ namespace __debug this->_M_invalidate_if([__next](_Base_const_iterator __it) { return __it == __next; }); __to_destroy.splice_after(__to_destroy.cbefore_begin(), - _M_base(), __first); + *this, __first); __next = __first; _GLIBCXX20_ONLY( __removed++ ); } @@ -804,7 +803,7 @@ namespace __debug return __it != __list._M_base().cbefore_begin() && __it != __list._M_base().cend(); }); - _Base::merge(std::move(__list._M_base())); + _Base::merge(std::move(__list)); } } @@ -827,7 +826,7 @@ namespace __debug return __it != __list._M_base().cbefore_begin() && __it != __list._M_base().cend(); }); - _Base::merge(std::move(__list._M_base()), __comp); + _Base::merge(std::move(__list), __comp); } } diff --git a/libstdc++-v3/include/debug/list b/libstdc++-v3/include/debug/list index f40ebc8521e..383482c0acf 100644 --- a/libstdc++-v3/include/debug/list +++ b/libstdc++-v3/include/debug/list @@ -122,8 +122,8 @@ namespace __debug noexcept( std::is_nothrow_constructible<_Base, _Base, const allocator_type&>::value ) - : _Safe(std::move(__x._M_safe()), __a), - _Base(std::move(__x._M_base()), __a) { } + : _Safe(std::move(__x), __a), + _Base(std::move(__x), __a) { } #endif explicit @@ -172,7 +172,7 @@ namespace __debug operator=(initializer_list __l) { this->_M_invalidate_all(); - _M_base() = __l; + _Base::operator=(__l); return *this; } @@ -583,7 +583,7 @@ namespace __debug _M_message(__gnu_debug::__msg_self_splice) ._M_sequence(*this, "this")); this->_M_transfer_from_if(__x, _Not_equal(__x._M_base().end())); - _Base::splice(__position.base(), _GLIBCXX_MOVE(__x._M_base())); + _Base::splice(__position.base(), _GLIBCXX_MOVE(__x)); } #if __cplusplus >= 201103L @@ -614,7 +614,7 @@ namespace __debug // _GLIBCXX_RESOLVE_LIB_DEFECTS // 250. splicing invalidates iterators this->_M_transfer_from_if(__x, _Equal(__i.base())); - _Base::splice(__position.base(), _GLIBCXX_MOVE(__x._M_base()), + _Base::splice(__position.base(), _GLIBCXX_MOVE(__x), __i.base()); } @@ -662,7 +662,7 @@ namespace __debug this->_M_transfer_from_if(__x, _Equal(__tmp)); } - _Base::splice(__position.base(), _GLIBCXX_MOVE(__x._M_base()), + _Base::splice(__position.base(), _GLIBCXX_MOVE(__x), __first.base(), __last.base()); } @@ -709,7 +709,7 @@ namespace __debug // 526. Is it undefined if a function in the standard changes // in parameters? this->_M_invalidate_if(_Equal(__first)); - __to_destroy.splice(__to_destroy.begin(), _M_base(), __first); + __to_destroy.splice(__to_destroy.begin(), *this, __first); #if !_GLIBCXX_USE_CXX11_ABI _GLIBCXX20_ONLY( __removed++ ); #endif @@ -743,7 +743,7 @@ namespace __debug if (__pred(*__x)) { this->_M_invalidate_if(_Equal(__x)); - __to_destroy.splice(__to_destroy.begin(), _M_base(), __x); + __to_destroy.splice(__to_destroy.begin(), *this, __x); #if !_GLIBCXX_USE_CXX11_ABI _GLIBCXX20_ONLY( __removed++ ); #endif @@ -780,7 +780,7 @@ namespace __debug if (*__first == *__next) { this->_M_invalidate_if(_Equal(__next)); - __to_destroy.splice(__to_destroy.begin(), _M_base(), __next); + __to_destroy.splice(__to_destroy.begin(), *this, __next); __next = __first; #if !_GLIBCXX_USE_CXX11_ABI _GLIBCXX20_ONLY( __removed++ ); @@ -818,7 +818,7 @@ namespace __debug if (__binary_pred(*__first, *__next)) { this->_M_invalidate_if(_Equal(__next)); - __to_destroy.splice(__to_destroy.begin(), _M_base(), __next); + __to_destroy.splice(__to_destroy.begin(), *this, __next); __next = __first; #if !_GLIBCXX_USE_CXX11_ABI _GLIBCXX20_ONLY( __removed++ ); @@ -851,7 +851,7 @@ namespace __debug __glibcxx_check_sorted(_Base::begin(), _Base::end()); __glibcxx_check_sorted(__x.begin().base(), __x.end().base()); this->_M_transfer_from_if(__x, _Not_equal(__x._M_base().end())); - _Base::merge(_GLIBCXX_MOVE(__x._M_base())); + _Base::merge(_GLIBCXX_MOVE(__x)); } } @@ -878,7 +878,7 @@ namespace __debug __glibcxx_check_sorted_pred(__x.begin().base(), __x.end().base(), __comp); this->_M_transfer_from_if(__x, _Not_equal(__x._M_base().end())); - _Base::merge(_GLIBCXX_MOVE(__x._M_base()), __comp); + _Base::merge(_GLIBCXX_MOVE(__x), __comp); } } diff --git a/libstdc++-v3/include/debug/map.h b/libstdc++-v3/include/debug/map.h index 3883c546871..c62f0b574e6 100644 --- a/libstdc++-v3/include/debug/map.h +++ b/libstdc++-v3/include/debug/map.h @@ -118,9 +118,9 @@ namespace __debug : _Base(__m, __a) { } map(map&& __m, const __type_identity_t& __a) - noexcept( noexcept(_Base(std::move(__m._M_base()), __a)) ) - : _Safe(std::move(__m._M_safe()), __a), - _Base(std::move(__m._M_base()), __a) { } + noexcept( noexcept(_Base(std::move(__m), __a)) ) + : _Safe(std::move(__m), __a), + _Base(std::move(__m), __a) { } map(initializer_list __l, const allocator_type& __a) : _Base(__l, __a) { } @@ -162,7 +162,7 @@ namespace __debug map& operator=(initializer_list __l) { - _M_base() = __l; + _Base::operator=(__l); this->_M_invalidate_all(); return *this; } diff --git a/libstdc++-v3/include/debug/multimap.h b/libstdc++-v3/include/debug/multimap.h index 073c1c39240..5f0f1faa33e 100644 --- a/libstdc++-v3/include/debug/multimap.h +++ b/libstdc++-v3/include/debug/multimap.h @@ -119,9 +119,9 @@ namespace __debug : _Base(__m, __a) { } multimap(multimap&& __m, const __type_identity_t& __a) - noexcept( noexcept(_Base(std::move(__m._M_base()), __a)) ) - : _Safe(std::move(__m._M_safe()), __a), - _Base(std::move(__m._M_base()), __a) { } + noexcept( noexcept(_Base(std::move(__m), __a)) ) + : _Safe(std::move(__m), __a), + _Base(std::move(__m), __a) { } multimap(initializer_list __l, const allocator_type& __a) : _Base(__l, __a) { } @@ -162,7 +162,7 @@ namespace __debug multimap& operator=(initializer_list __l) { - _M_base() = __l; + _Base::operator=(__l); this->_M_invalidate_all(); return *this; } diff --git a/libstdc++-v3/include/debug/multiset.h b/libstdc++-v3/include/debug/multiset.h index 479411d9d06..7729fc19689 100644 --- a/libstdc++-v3/include/debug/multiset.h +++ b/libstdc++-v3/include/debug/multiset.h @@ -118,9 +118,9 @@ namespace __debug : _Base(__m, __a) { } multiset(multiset&& __m, const __type_identity_t& __a) - noexcept( noexcept(_Base(std::move(__m._M_base()), __a)) ) - : _Safe(std::move(__m._M_safe()), __a), - _Base(std::move(__m._M_base()), __a) { } + noexcept( noexcept(_Base(std::move(__m), __a)) ) + : _Safe(std::move(__m), __a), + _Base(std::move(__m), __a) { } multiset(initializer_list __l, const allocator_type& __a) : _Base(__l, __a) @@ -162,7 +162,7 @@ namespace __debug multiset& operator=(initializer_list __l) { - _M_base() = __l; + _Base::operator=(__l); this->_M_invalidate_all(); return *this; } diff --git a/libstdc++-v3/include/debug/safe_container.h b/libstdc++-v3/include/debug/safe_container.h index 5de55d69f34..caba37a1207 100644 --- a/libstdc++-v3/include/debug/safe_container.h +++ b/libstdc++-v3/include/debug/safe_container.h @@ -48,10 +48,6 @@ namespace __gnu_debug { return *static_cast<_SafeContainer*>(this); } protected: - _Safe_container& - _M_safe() _GLIBCXX_NOEXCEPT - { return *this; } - #if __cplusplus >= 201103L _Safe_container() = default; _Safe_container(const _Safe_container&) = default; diff --git a/libstdc++-v3/include/debug/set.h b/libstdc++-v3/include/debug/set.h index e35e5c1faae..39142aef60b 100644 --- a/libstdc++-v3/include/debug/set.h +++ b/libstdc++-v3/include/debug/set.h @@ -117,9 +117,9 @@ namespace __debug : _Base(__x, __a) { } set(set&& __x, const __type_identity_t& __a) - noexcept( noexcept(_Base(std::move(__x._M_base()), __a)) ) - : _Safe(std::move(__x._M_safe()), __a), - _Base(std::move(__x._M_base()), __a) { } + noexcept( noexcept(_Base(std::move(__x), __a)) ) + : _Safe(std::move(__x), __a), + _Base(std::move(__x), __a) { } set(initializer_list __l, const allocator_type& __a) : _Base(__l, __a) { } @@ -160,7 +160,7 @@ namespace __debug set& operator=(initializer_list __l) { - _M_base() = __l; + _Base::operator=(__l); this->_M_invalidate_all(); return *this; } diff --git a/libstdc++-v3/include/debug/string b/libstdc++-v3/include/debug/string index 2209f88fd54..dd16527b958 100644 --- a/libstdc++-v3/include/debug/string +++ b/libstdc++-v3/include/debug/string @@ -160,8 +160,8 @@ namespace __gnu_debug basic_string(basic_string&& __s, const _Allocator& __a) noexcept( std::is_nothrow_constructible<_Base, _Base, const _Allocator&>::value ) - : _Safe(std::move(__s._M_safe()), __a), - _Base(std::move(__s._M_base()), __a) + : _Safe(std::move(__s), __a), + _Base(std::move(__s), __a) { } ~basic_string() = default; @@ -213,7 +213,7 @@ namespace __gnu_debug operator=(const _CharT* __s) { __glibcxx_check_string(__s); - _M_base() = __s; + _Base::operator=(__s); this->_M_invalidate_all(); return *this; } @@ -221,7 +221,7 @@ namespace __gnu_debug basic_string& operator=(_CharT __c) { - _M_base() = __c; + _Base::operator=(__c); this->_M_invalidate_all(); return *this; } @@ -230,7 +230,7 @@ namespace __gnu_debug basic_string& operator=(std::initializer_list<_CharT> __l) { - _M_base() = __l; + _Base::operator=(__l); this->_M_invalidate_all(); return *this; } @@ -341,7 +341,7 @@ namespace __gnu_debug ._M_sequence(*this, "this") ._M_integer(__pos, "__pos") ._M_integer(this->size(), "size")); - return _M_base()[__pos]; + return _Base::operator[](__pos); } reference @@ -357,7 +357,7 @@ namespace __gnu_debug ._M_integer(__pos, "__pos") ._M_integer(this->size(), "size")); #endif - return _M_base()[__pos]; + return _Base::operator[](__pos); } using _Base::at; @@ -371,7 +371,7 @@ namespace __gnu_debug basic_string& operator+=(const basic_string& __str) { - _M_base() += __str; + _Base::operator+=(__str); this->_M_invalidate_all(); return *this; } @@ -380,7 +380,7 @@ namespace __gnu_debug operator+=(const _CharT* __s) { __glibcxx_check_string(__s); - _M_base() += __s; + _Base::operator+=(__s); this->_M_invalidate_all(); return *this; } @@ -388,7 +388,7 @@ namespace __gnu_debug basic_string& operator+=(_CharT __c) { - _M_base() += __c; + _Base::operator+=(__c); this->_M_invalidate_all(); return *this; } @@ -397,7 +397,7 @@ namespace __gnu_debug basic_string& operator+=(std::initializer_list<_CharT> __l) { - _M_base() += __l; + _Base::operator+=(__l); this->_M_invalidate_all(); return *this; } diff --git a/libstdc++-v3/include/debug/unordered_map b/libstdc++-v3/include/debug/unordered_map index d6e184a2e99..64cc8bacabd 100644 --- a/libstdc++-v3/include/debug/unordered_map +++ b/libstdc++-v3/include/debug/unordered_map @@ -150,9 +150,9 @@ namespace __debug unordered_map(unordered_map&& __umap, const allocator_type& __a) - noexcept( noexcept(_Base(std::move(__umap._M_base()), __a)) ) - : _Safe(std::move(__umap._M_safe()), __a), - _Base(std::move(__umap._M_base()), __a) { } + noexcept( noexcept(_Base(std::move(__umap), __a)) ) + : _Safe(std::move(__umap), __a), + _Base(std::move(__umap), __a) { } unordered_map(initializer_list __l, size_type __n = 0, @@ -210,7 +210,7 @@ namespace __debug unordered_map& operator=(initializer_list __l) { - _M_base() = __l; + _Base::operator=(__l); this->_M_invalidate_all(); return *this; } @@ -561,7 +561,7 @@ namespace __debug { auto __guard = _Safe::_S_uc_guard(std::__detail::_Select1st{}, __source); - _Base::merge(__source._M_base()); + _Base::merge(__source); } template @@ -575,7 +575,7 @@ namespace __debug { auto __guard = _Safe::_S_umc_guard(std::__detail::_Select1st{}, __source); - _Base::merge(__source._M_base()); + _Base::merge(__source); } template @@ -953,9 +953,9 @@ namespace __debug unordered_multimap(unordered_multimap&& __umap, const allocator_type& __a) - noexcept( noexcept(_Base(std::move(__umap._M_base()), __a)) ) - : _Safe(std::move(__umap._M_safe()), __a), - _Base(std::move(__umap._M_base()), __a) { } + noexcept( noexcept(_Base(std::move(__umap), __a)) ) + : _Safe(std::move(__umap), __a), + _Base(std::move(__umap), __a) { } unordered_multimap(initializer_list __l, size_type __n = 0, @@ -1010,7 +1010,7 @@ namespace __debug unordered_multimap& operator=(initializer_list __l) { - this->_M_base() = __l; + _Base::operator=(__l); this->_M_invalidate_all(); return *this; } @@ -1270,7 +1270,7 @@ namespace __debug { auto __guard = _Safe::_S_umc_guard(std::__detail::_Select1st{}, __source); - _Base::merge(__source._M_base()); + _Base::merge(__source); } template @@ -1284,7 +1284,7 @@ namespace __debug { auto __guard = _Safe::_S_uc_guard(std::__detail::_Select1st{}, __source); - _Base::merge(__source._M_base()); + _Base::merge(__source); } template diff --git a/libstdc++-v3/include/debug/unordered_set b/libstdc++-v3/include/debug/unordered_set index 7dc91fa862d..3516af4dc4e 100644 --- a/libstdc++-v3/include/debug/unordered_set +++ b/libstdc++-v3/include/debug/unordered_set @@ -146,9 +146,9 @@ namespace __debug unordered_set(unordered_set&& __uset, const allocator_type& __a) - noexcept( noexcept(_Base(std::move(__uset._M_base()), __a)) ) - : _Safe(std::move(__uset._M_safe()), __a), - _Base(std::move(__uset._M_base()), __a) { } + noexcept( noexcept(_Base(std::move(__uset), __a)) ) + : _Safe(std::move(__uset), __a), + _Base(std::move(__uset), __a) { } unordered_set(initializer_list __l, size_type __n = 0, @@ -203,7 +203,7 @@ namespace __debug unordered_set& operator=(initializer_list __l) { - _M_base() = __l; + _Base::operator=(__l); this->_M_invalidate_all(); return *this; } @@ -448,7 +448,7 @@ namespace __debug { auto __guard = _Safe::_S_uc_guard(std::__detail::_Identity{}, __source); - _Base::merge(__source._M_base()); + _Base::merge(__source); } template @@ -462,7 +462,7 @@ namespace __debug { auto __guard = _Safe::_S_umc_guard(std::__detail::_Identity{}, __source); - _Base::merge(__source._M_base()); + _Base::merge(__source); } template @@ -819,9 +819,9 @@ namespace __debug unordered_multiset(unordered_multiset&& __uset, const allocator_type& __a) - noexcept( noexcept(_Base(std::move(__uset._M_base()), __a)) ) - : _Safe(std::move(__uset._M_safe()), __a), - _Base(std::move(__uset._M_base()), __a) { } + noexcept( noexcept(_Base(std::move(__uset), __a)) ) + : _Safe(std::move(__uset), __a), + _Base(std::move(__uset), __a) { } unordered_multiset(initializer_list __l, size_type __n = 0, @@ -876,7 +876,7 @@ namespace __debug unordered_multiset& operator=(initializer_list __l) { - this->_M_base() = __l; + _Base::operator=(__l); this->_M_invalidate_all(); return *this; } @@ -1116,7 +1116,7 @@ namespace __debug { auto __guard = _Safe::_S_umc_guard(std::__detail::_Identity{}, __source); - _Base::merge(__source._M_base()); + _Base::merge(__source); } template @@ -1130,7 +1130,7 @@ namespace __debug { auto __guard = _Safe::_S_uc_guard(std::__detail::_Identity{}, __source); - _Base::merge(__source._M_base()); + _Base::merge(__source); } template diff --git a/libstdc++-v3/include/debug/vector b/libstdc++-v3/include/debug/vector index b532a168e0e..ed10e82c080 100644 --- a/libstdc++-v3/include/debug/vector +++ b/libstdc++-v3/include/debug/vector @@ -219,8 +219,8 @@ namespace __debug noexcept( std::is_nothrow_constructible<_Base, _Base, const allocator_type&>::value ) - : _Safe(std::move(__x._M_safe()), __a), - _Base(std::move(__x._M_base()), __a), + : _Safe(std::move(__x), __a), + _Base(std::move(__x), __a), _Safe_vector(std::move(__x)) { } vector(initializer_list __l, @@ -244,7 +244,7 @@ namespace __debug vector& operator=(initializer_list __l) { - _M_base() = __l; + _Base::operator=(__l); this->_M_invalidate_all(); this->_M_update_guaranteed_capacity(); return *this; @@ -440,7 +440,7 @@ namespace __debug operator[](size_type __n) _GLIBCXX_NOEXCEPT { __glibcxx_check_subscript(__n); - return _M_base()[__n]; + return _Base::operator[](__n); } _GLIBCXX_NODISCARD @@ -448,7 +448,7 @@ namespace __debug operator[](size_type __n) const _GLIBCXX_NOEXCEPT { __glibcxx_check_subscript(__n); - return _M_base()[__n]; + return _Base::operator[](__n); } using _Base::at;