From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11127 invoked by alias); 7 May 2009 19:05:50 -0000 Received: (qmail 8562 invoked by uid 48); 7 May 2009 19:05:35 -0000 Date: Thu, 07 May 2009 19:05:00 -0000 Message-ID: <20090507190535.8561.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/39126] Missing "move" constructor call (C++0x rvalue references) In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "gbrammer at gmx dot de" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-05/txt/msg00611.txt.bz2 ------- Comment #1 from gbrammer at gmx dot de 2009-05-07 19:05 ------- Still happens with "g++-4.4 (Debian 4.4.0-4) 4.4.1". Here's a version with printfs in the destructor and constructors: extern "C" { int printf(const char *format, ...); } struct Foo { Foo(Foo && from) { printf("move constructor\n"); } Foo() { printf("constructor\n"); } ~Foo() { printf("destructor\n"); } /*private: Foo(const Foo & from) { printf("copy constructor\n"); }*/ }; Foo CreateFoo(bool b) { Foo f; if (b) return Foo(); return f; } int main () { Foo f(CreateFoo(false)); } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39126