[Bug c++/15172] Copy constructor optimization in aggregate initialization

2004-10-16 Thread acehreli at yahoo dot com

--- 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:


[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].




-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15172


[Bug c++/15172] [3.3/3.4 regression] Copy constructor optimization in aggregate initialization

2004-10-16 Thread acehreli at yahoo dot com

--- Additional Comments From acehreli at yahoo dot com  2004-10-17 01:01 ---
We've seen the problem in 2.95.3 and 3.4.2.

There is a recent posting to comp.lang.c++.moderated about the same problem, 
with the subject "Bitwise copy during aggregate initialization (a compiler 
bug?)".

Ali


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15172