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: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Apr 2004 17:24:18 -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 pinskia at gcc dot gnu dot org 2004-04-27 17:24 -------
>From 12.6.1p2: "each such member is copy-initialized (see 8.5)"
>From 8.5p14: "The result of the call (which is the temporary for the constructor case) is then used to
direct-initialize, according to the rules above, the object that is the destination of the copy-
initialization. In certain cases, an implementation is permitted to eliminate the copying inherent in this
direct-initialization by constructing the intermediate result directly into the object being initialized; see
12.2, 12.8. "
What 12.8 says is that it does not have call the copy constructor at all but it still can.
Well that this case so this is invalid.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15172