From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30015 invoked by alias); 6 Dec 2016 14:34:19 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 29994 invoked by uid 89); 6 Dec 2016 14:34:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.8 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1819, Partial X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Dec 2016 14:34:16 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C5D3868B2; Tue, 6 Dec 2016 14:34:14 +0000 (UTC) Received: from localhost (ovpn-116-110.ams2.redhat.com [10.36.116.110]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uB6EYD6o029868; Tue, 6 Dec 2016 09:34:14 -0500 Date: Tue, 06 Dec 2016 14:34:00 -0000 From: Jonathan Wakely To: Tim Shen Cc: libstdc++ , gcc-patches Subject: Re: [PATCH] Partial solution to LWG 523 Message-ID: <20161206143413.GL6326@redhat.com> References: <20161130130324.GQ3301@redhat.com> <20161130144526.GR3301@redhat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="L6iaP+gRLNZHKoI4" Content-Disposition: inline In-Reply-To: <20161130144526.GR3301@redhat.com> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.7.1 (2016-10-04) X-SW-Source: 2016-12/txt/msg00458.txt.bz2 --L6iaP+gRLNZHKoI4 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline Content-length: 921 On 30/11/16 14:45 +0000, Jonathan Wakely wrote: >On 30/11/16 13:03 +0000, Jonathan Wakely wrote: >>On 26/11/16 16:27 -0800, Tim Shen wrote: >>>diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h >>>index 953aa87..2fb70b7 100644 >>>--- a/libstdc++-v3/include/bits/shared_ptr_base.h >>>+++ b/libstdc++-v3/include/bits/shared_ptr_base.h >>>@@ -1000,7 +1000,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >>> element_type& >>> operator*() const noexcept >>> { >>>- __glibcxx_assert(_M_ptr != nullptr); >>>+ __glibcxx_assert(_M_get() != nullptr); >>> return *_M_get(); >>> } >> >>Oops, thanks, but let's fix this separately (I'll do it now) so the >>rest of the patch only touches regex stuff. > >I've fixed that with this patch, committed to trunk. > There's a similar problem in the __shared_ptr_access specialization for shared_ptr, fixed by this patch. --L6iaP+gRLNZHKoI4 Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" Content-length: 926 commit b69bee71a9eaa91f3a6fae875d702c9d39b02354 Author: Jonathan Wakely Date: Tue Dec 6 14:13:54 2016 +0000 Fix debug mode assertion for std::shared_ptr * include/bits/shared_ptr_base.h (__shared_ptr_access::operator->()): Fix assertion. diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h index 2fb70b7..7e02043 100644 --- a/libstdc++-v3/include/bits/shared_ptr_base.h +++ b/libstdc++-v3/include/bits/shared_ptr_base.h @@ -983,8 +983,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION element_type* operator->() const noexcept { - _GLIBCXX_DEBUG_PEDASSERT(_M_get() != nullptr); - return static_cast*>(this)->get(); + auto __ptr = static_cast*>(this)->get(); + _GLIBCXX_DEBUG_PEDASSERT(__ptr != nullptr); + return __ptr; } }; --L6iaP+gRLNZHKoI4--