From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78453 invoked by alias); 3 Nov 2015 23:09:41 -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 78426 invoked by uid 89); 3 Nov 2015 23:09:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 X-HELO: resqmta-po-01v.sys.comcast.net Received: from resqmta-po-01v.sys.comcast.net (HELO resqmta-po-01v.sys.comcast.net) (96.114.154.160) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 03 Nov 2015 23:09:39 +0000 Received: from resomta-po-12v.sys.comcast.net ([96.114.154.236]) by resqmta-po-01v.sys.comcast.net with comcast id dB9U1r00356HXL001B9d54; Tue, 03 Nov 2015 23:09:37 +0000 Received: from [IPv6:2001:558:6045:a4:40c6:7199:cd03:b02d] ([IPv6:2001:558:6045:a4:40c6:7199:cd03:b02d]) by resomta-po-12v.sys.comcast.net with comcast id dB9c1r0012ztT3H01B9cTH; Tue, 03 Nov 2015 23:09:37 +0000 Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: [PATCH] Add configure flag for operator new (std::nothrow) From: Mike Stump In-Reply-To: <563922C6.7080706@gmail.com> Date: Tue, 03 Nov 2015 23:09:00 -0000 Cc: Daniel Gutson , Aurelio Remonda , libstdc++@gcc.gnu.org, "gcc-patches@gcc.gnu.org" , daniel.gutston@tallertechnologies.com, Jonathan Wakely Content-Transfer-Encoding: quoted-printable Message-Id: <3937336D-6170-4513-A658-A2835E87FB0C@comcast.net> References: <1446554133-3090-1-git-send-email-aurelio.remonda@tallertechnologies.com> <56391843.1070807@gmail.com> <563922C6.7080706@gmail.com> To: Martin Sebor X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg00281.txt.bz2 On Nov 3, 2015, at 1:10 PM, Martin Sebor wrote: > The "as if" requirement implies that any observable effects of > "the (possibly replaced) ordinary version" must be preserved. > The repeated calls to the new handler are among such effects. Unless the standard is fixed to say that one cannot observe the repeated ca= lls. We do this in some places, for some things: 15Whenever a temporary class object is copied using a copy constructor, and this object and the copy have the same cv-unqualified type, an implementation is permitted to treat the original and the copy as two different ways of referring to the same object and not perform a copy at all, even if the class copy constructor or destructor have side effects. For a function with a class return type, if the expression in the return statement is the name of a local object, and the cv- unqualified type of the local object is the same as the function return type, an implementation is permitted to omit creating the tem- porary object to hold the function return value, even if the class copy constructor or destructor has side effects. In these cases, the object is destroyed at the later of times when the original and the copy would have been destroyed without the optimization.111) in C++, so, it isn=92t out of the question. I was looking for dynamic -> s= tatic object optimization wording, but didn=92t find it in the first C++ st= andard. That is a fairly reasonable thing to do, and if done well, can rea= sonably change the observable side-effects as well.