Return-Path: Delivered-To: apmail-stdcxx-dev-archive@www.apache.org Received: (qmail 19564 invoked from network); 29 Jul 2008 18:15:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Jul 2008 18:15:30 -0000 Received: (qmail 28120 invoked by uid 500); 29 Jul 2008 18:15:29 -0000 Delivered-To: apmail-stdcxx-dev-archive@stdcxx.apache.org Received: (qmail 28099 invoked by uid 500); 29 Jul 2008 18:15:29 -0000 Mailing-List: contact dev-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list dev@stdcxx.apache.org Received: (qmail 28088 invoked by uid 99); 29 Jul 2008 18:15:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jul 2008 11:15:29 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of msebor@gmail.com designates 74.125.44.30 as permitted sender) Received: from [74.125.44.30] (HELO yx-out-2324.google.com) (74.125.44.30) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jul 2008 18:14:34 +0000 Received: by yx-out-2324.google.com with SMTP id 8so660220yxb.53 for ; Tue, 29 Jul 2008 11:14:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :organization:user-agent:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding:sender; bh=dJF4Lr0UJJ1s2cYQvEJpZdV1KvGZlshLQtzjE1a8eH4=; b=M2a6CF10v5e6pGEH72/3DULm1Wse5PlbzVqkhgPZhbMmmZg3heC8guR/FkEWhKuiIO 04oo9H3B4Ks9FO/I+XrZoosQ81zxz8oWJaq0H42ry1YW8KCMK8RAB97QS+RaxwV4B93G /tHDjut5nDQDiWfdH+dsma3xNmkGbSWZvoNgk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:organization:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding:sender; b=JiqYSwPs9TV96V3bKQPcA7NNioFFJrxSr248yOKW2XAZCiSbfXVfK0yJtv/B/lYIDj b8TA+yC7bajeC4uO/BZ/nCFQJ+OVETGSJ03op67ofURZJlpkPGfECfPjfloP3h+VsXQ+ W0XTt7rky/ETDz3xXrnd91U7baTXkRt2bERjg= Received: by 10.142.162.9 with SMTP id k9mr2263521wfe.93.1217355298902; Tue, 29 Jul 2008 11:14:58 -0700 (PDT) Received: from localhost.localdomain ( [71.229.200.170]) by mx.google.com with ESMTPS id 30sm17983706wfg.9.2008.07.29.11.14.58 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 29 Jul 2008 11:14:58 -0700 (PDT) Message-ID: <488F5E12.4030108@roguewave.com> Date: Tue, 29 Jul 2008 12:14:42 -0600 From: Martin Sebor Organization: Rogue Wave Software, Inc. User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: dev@stdcxx.apache.org CC: Travis Vitek Subject: Re: svn commit: r680756 - in /stdcxx/branches/4.2.x: include/loc/_codecvt.cc include/loc/_codecvt.h include/loc/_collate.cc include/loc/_collate.h include/loc/_moneypunct.cc include/loc/_moneypunct.h src/codecvt.cpp src/collate.cpp src/wcodecvt.cpp References: <20080729162428.9D65723889FF@eris.apache.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: Martin Sebor X-Virus-Checked: Checked by ClamAV on apache.org Travis Vitek wrote: > > >> Author: sebor >> Date: Tue Jul 29 09:24:16 2008 >> New Revision: 680756 >> >> Modified: stdcxx/branches/4.2.x/include/loc/_codecvt.h >> URL: >> http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/loc/ >> _codecvt.h?rev=680756&r1=680755&r2=680756&view=diff >> =============================================================== >> =============== >> --- stdcxx/branches/4.2.x/include/loc/_codecvt.h (original) >> +++ stdcxx/branches/4.2.x/include/loc/_codecvt.h Tue Jul 29 >> 09:24:16 2008 >> @@ -120,6 +120,8 @@ >> >> _EXPLICIT codecvt (_RWSTD_SIZE_T __ref = 0): >> _RW::__rw_facet (__ref) { } >> >> + virtual ~codecvt () _RWSTD_ATTRIBUTE_NOTHROW; >> + > > Are you sure you don't want to be using _RWSTD_DECLARE_NOTHROW here, and > _RWSTD_DEFINE_NOTHROW with the definition. I only see > _RWSTD_ATTRIBUTE_NOTHROW being defined for gcc, and that means compile > error for all other configurations. Whoops! You're right, this wouldn't work without a definition of the macro on platforms that don't support the attribute. I just checked in the change that adds this definition. Sorry for the our-of-band commit! (I'm working with one local copy too many...) > > What is the rationale for using the attribute instead of a throw spec? I > realize that _RWSTD_ATTRIBUTE_NOTHROW will end up being an empty throw > spec on most platforms, but I don't understand the advantage of using > the attribute. I see that you use both in this changelist, but I don't > understand why you selected one over the other. We don't want _RWSTD_DECLARE_NOTHROW because the macro expands to throw() on platforms w/o the attribute and we're not allowed to tighten the throw spec for virtual functions (because users wouldn't be able declare overrides with looser spec in derived classes). So the best we can do is affirm the requirement that dtors don't throw via the attribute, w/o forcing users to do the same using throw()). > > It seems that the only difference is that, in the worst case, using > throw specs might require an try/catch block be inserted into the > definition of the destructor and that should not result in much > additional code. Of course this would only happen if the compiler cannot > determine that no exception is thrown by base or member destructors, > which it should be able to do if they are appropriately decorated. > > That said, it seems that it would be best to decorate the base class > (_RW::__rw_facet) destructor similarly, regardless of what decoration is > being used. Agreed. I have this change scheduled next. I suppose I should have committed it first. Or added the virtual dtors without the attribute first, and then decorated them with it in a separate check in. Yeah, that would have been the way to do it. I was trying to do unrelated things separately but clearly didn't do a very good job of it... > >> // 22,2,1,5,1, p1 >> result out (state_type& __state, >> const intern_type* __from, const intern_type* >> __from_end, >> @@ -188,7 +190,7 @@ >> >> _EXPLICIT codecvt (_RWSTD_SIZE_T = 0); >> >> - virtual ~codecvt (); >> + virtual ~codecvt () _RWSTD_ATTRIBUTE_NOTHROW; > > I see no mention of adding this attribute in the changelog. Should there > be? Yes, I should have mentioned it. Thanks for the reminder. I added a mention of this change to the log. Thanks for keeping an eye on me! Martin > > Travis >