public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jpalecek at web dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/54293] When a reference is bound to subobject of a temporary, lifetime of the temporary is not extended
Date: Tue, 21 Aug 2012 07:52:00 -0000	[thread overview]
Message-ID: <bug-54293-4-mHX8Rfpe5B@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-54293-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #10 from Jiří Paleček <jpalecek at web dot de> 2012-08-21 07:51:55 UTC ---
(In reply to comment #9)
> (In reply to comment #8)
> > > I agree with your analysis, but would like to point out that there is change
> > > planned to essentially this part of the wording due to 
> > > 
> > > http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#616
> > > 
> > > Assuming it becomes accepted E1.E2 will become an xvalue in this case (SE
> > > bullet 2 of the P/R)
> > 
> > Thanks for the info, it is interesting (although I can't see the relevance of
> > this particular change to the issues it should solve, which are basically about
> > using uninitialized objects).
> 
> Well, this addition *would* change the expected outcome. Because given the CWG
> 616 P/R the expression
> 
> ValueHolder<int>().v
> 
> becomes an xvalue (The special rule about class rvalues is no longer relevant
> here), this means that the compiler shall *not* copy-initialize a temporary as
> described in the very last bullet of 8.5.3/5.
> 
> In other words: In this case IsValid(&ref_int) will hold for the same reasons
> as it holds for IsValid(&ref_obj).

That is true, and I didn't object that. I rather didn't understand how is that
particular change related to solving issues 616, 129, 240 and some others
mentioned there.


  parent reply	other threads:[~2012-08-21  7:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-16 22:28 [Bug c++/54293] New: " ppluzhnikov at google dot com
2012-08-16 23:02 ` [Bug c++/54293] " pinskia at gcc dot gnu.org
2012-08-16 23:07 ` ppluzhnikov at google dot com
2012-08-17 14:19 ` aaw at gcc dot gnu.org
2012-08-17 14:55 ` jpalecek at web dot de
2012-08-20 18:14 ` crowl at gcc dot gnu.org
2012-08-20 21:56 ` jpalecek at web dot de
2012-08-20 22:18 ` daniel.kruegler at googlemail dot com
2012-08-20 22:52 ` jpalecek at web dot de
2012-08-21  6:14 ` daniel.kruegler at googlemail dot com
2012-08-21  7:52 ` jpalecek at web dot de [this message]
2012-08-21  8:08 ` daniel.kruegler at googlemail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-54293-4-mHX8Rfpe5B@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).