This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: an rvalue reference question
- From: "John (Eljay) Love-Jensen" <eljay at adobe dot com>
- To: "Lin, Chih-Long" <clin1 at telcordia dot com>, GCC-help <gcc-help at gcc dot gnu dot org>
- Date: Fri, 9 Jan 2009 07:43:33 -0800
- Subject: Re: an rvalue reference question
Hi Chih-Long,
> blah z((blah())); // expecting calling blah::blah() and blah::blah(blah&&) but
got only blah::blah()
C++ allows this to be optimized, by eliding the copy constructor. This
optimization is in the ISO 14882 specification.
This C++ optimization will occur even if you¹ve disabled GCC¹s optimizations
(-O0).
Try this flag to disable the C++ optimization: -fno-elide-constructors
HTH,
<Eljay