This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]