This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: optimization bug? in initialization of class variable
- From: Nathan Sidwell <nathan at acm dot org>
- To: "Andrew J. Malton" <ajmalton at uwaterloo dot ca>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 14 Dec 2001 16:53:49 +0000
- Subject: Re: optimization bug? in initialization of class variable
- References: <51C641DF-F0AC-11D5-96E5-0003931281D4@uwaterloo.ca>
- Reply-to: nathan at compsci dot bristol dot ac dot uk
"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