This is the mail archive of the gcc@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]

Re: optimization bug? in initialization of class variable


"Andrew J. Malton" wrote:
> 
> Is this a bug or a very wierd valid interpretation of the standard?
neither.


> where the T(e) denotes a temporary created with suitable conversion
> construction [8.5 14].  So this should invoke a conversion followed by a
> copy.   Both constructors have to be accessible [12.2 1].  Creation of
> the temporary T(e) may be `avoided' [12.2 2 example] but semantic
> restrictions (acessibility) must still be satisfied.
read [12.8]/15 which says some of the cases where a temporary can be
elided 'even if the class constructor or destructor have sideeffects'

This is one such case.

nathan
-- 
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
           The voices in my head told me to say this
nathan@acm.org  http://www.cs.bris.ac.uk/~nathan/  nathan@cs.bris.ac.uk


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