From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5048 invoked by alias); 7 Jul 2005 11:45:48 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 5033 invoked by uid 22791); 7 Jul 2005 11:45:45 -0000 Received: from server15.firstfind.nl (HELO server15.firstfind.nl) (217.170.3.184) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 07 Jul 2005 11:45:45 +0000 Received: from userservices.server15.firstfind.nl (localhost [127.0.0.1]) by server15.firstfind.nl (8.12.3/8.12.3/Debian-7.9) with SMTP id j67BjJa6001762 for ; Thu, 7 Jul 2005 13:45:19 +0200 Received: from 195.64.81.210 (SquirrelMail authenticated user wijnhout01) by userservices.server15.firstfind.nl with HTTP; Thu, 7 Jul 2005 13:45:19 +0200 (CEST) Message-ID: <62024.195.64.81.210.1120736719.squirrel@userservices.server15.firstfind.nl> In-Reply-To: <6.2.1.2.2.20050705090751.0243dd68@iplan-mn.corp.adobe.com> References: <200507022024.10598.Jeroen.Wijnhout@kdemail.net><5d0f609905070305263875cb57@mail.gmail.com><200507031547.33672.Jeroen.Wijnhout@kdemail.net> <6.2.1.2.2.20050705090751.0243dd68@iplan-mn.corp.adobe.com> Date: Thu, 07 Jul 2005 11:45:00 -0000 Subject: Re: copy ctor not called From: "Jeroen Wijnhout" To: gcc-help@gcc.gnu.org User-Agent: SquirrelMail/1.4.2 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-SW-Source: 2005-07/txt/msg00072.txt.bz2 > Hi Jeroen, > >>To me this says, that I -fno-elide-constructors should be the default >> behavior. Which it isn't (at least for gcc 3.3.4). > > Due to the design and evolution of C++, your expectation that > "-fno-elide-constructors should be the default behavior" is not the case. > > I can understand where a person would expect that to be the situation. > > However, C++ standard has the elide "optimization" be the default behavior > for proper C++, and the -fno-elide-constructors is a non-compliant > pessimization. Hmm, I have the 2005 edition of "C++ Primer", which I kind of trusted because one of the authors was involved in the C++ ISO standards committee. They write in section 13.1 (page 477): "Copy-initialization always involves the copy constructor". According to your statement they are wrong. > Moreso, you've touched up the (surprising?) requirement for the copy > constructor to be public. > > These C++ anachronisms are due in large part to the design and evolution > of C++. They are legacy warts. Thanks for your explanation. best, Jeroen