From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 55365 invoked by alias); 28 May 2015 12:33:50 -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 55277 invoked by uid 89); 28 May 2015 12:33:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 28 May 2015 12:33:47 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 0A96B2B64BA; Thu, 28 May 2015 12:33:46 +0000 (UTC) Received: from localhost (ovpn-116-76.ams2.redhat.com [10.36.116.76]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t4SCXj41018194; Thu, 28 May 2015 08:33:45 -0400 Date: Thu, 28 May 2015 12:49:00 -0000 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: [patch] Make std::string default constructor conditionally noexcept Message-ID: <20150528123343.GN2985@redhat.com> References: <20150513133629.GI30202@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20150513133629.GI30202@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-05/txt/msg02631.txt.bz2 On 13/05/15 14:36 +0100, Jonathan Wakely wrote: >http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4383.html#2455 > >Voted into the WP in Lenexa. > >We already did the right thing for vector, so only basic_string needs >to change. > >Tested powerpc64le-linux, committed to trunk. Also committed to gcc-5-branch. >commit 634ed6e2d2ea4d69a29a8907044e6f68541d88aa >Author: Jonathan Wakely >Date: Wed May 13 14:21:37 2015 +0100 > > * include/bits/basic_string.h (basic_string::basic_string()): Make > noexcept conditional on allocator (LWG 2455). > >diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h >index 3e3eef4..093f502 100644 >--- a/libstdc++-v3/include/bits/basic_string.h >+++ b/libstdc++-v3/include/bits/basic_string.h >@@ -377,7 +377,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 > /** > * @brief Default constructor creates an empty string. > */ >- basic_string() _GLIBCXX_NOEXCEPT >+ basic_string() >+#if __cplusplus >= 201103L >+ noexcept(is_nothrow_default_constructible<_Alloc>::value) >+#endif > : _M_dataplus(_M_local_data()) > { _M_set_length(0); } >