From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23419 invoked by alias); 6 Jun 2004 01:05:14 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 23410 invoked by uid 48); 6 Jun 2004 01:05:13 -0000 Date: Sun, 06 Jun 2004 01:05:00 -0000 Message-ID: <20040606010513.23409.qmail@sourceware.org> From: "pinskia at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040528101645.15704.justin@cs.utah.edu> References: <20040528101645.15704.justin@cs.utah.edu> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/15704] Copy constructor is not called X-Bugzilla-Reason: CC X-SW-Source: 2004-06/txt/msg00610.txt.bz2 List-Id: ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-06 01:05 ------- Not a bug, read 12.2P2 >>From 12.2P2: [Example: class X { //... public: //... X(int); X(const X&); ~X(); }; X f(X); void g() { X a(1); X b = f(X(2)); a = f(a); } Here, an implementation might use a temporary in which to construct X(2) before passing it to f() using X’s copy-constructor; alternatively, X(2) might be constructed in the space used to hold the argument. Also, a temporary might be used to hold the result of f(X(2)) before copying it to b using X’s copy constructor; alternatively, f()’s result might be constructed in b. On the other hand, the expression a=f(a) requires a temporary for either the argumentaor the result of f(a) to avoid undesired aliasing of a. ] -- What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15704