This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15172] Copy constructor optimization in aggregate initialization
- From: "acehreli at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Oct 2004 22:57:32 -0000
- Subject: [Bug c++/15172] Copy constructor optimization in aggregate initialization
- References: <20040427165935.15172.michael.spencer@ubs.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From acehreli at yahoo dot com 2004-10-16 22:57 -------
I don't think the paragraphs from the standard that are mentioned above are
completely relevant. There isn't an opportunity for optimization in this case.
This is aggregate initialization.
I found the following paragraphs to be describing this case exactly:
8.5.1/1
8.5.1/13
12.6.1/2
The first example under 12.6.1/2 is directly relevant:
<quote>
[Example:
complex v[6] = { 1,complex(1,2),complex(),2 };
Here, complex::complex(double) is called for the initialization of v[0] and v
[3], complex::complex(double,double) is called for the initialization of v[1],
complex::complex() is called for the initialization v[2], v[4], and v[5].
</quote>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15172