This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53220] [4.7/4.8 Regression] g++ mis-compiles compound literals
- From: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 08 May 2012 02:13:35 +0000
- Subject: [Bug c++/53220] [4.7/4.8 Regression] g++ mis-compiles compound literals
- Auto-submitted: auto-generated
- References: <bug-53220-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53220
--- Comment #10 from Jason Merrill <jason at gcc dot gnu.org> 2012-05-08 02:13:35 UTC ---
(In reply to comment #9)
> c++11 defines the lifetime of a temporary -- does it match C or g++'s semantics
> of compound literals or neither?
C++98 and C++11 define the lifetime of a temporary as lasting until the end of
the full-expression, unless its lifetime is extended by binding it to a
reference. G++ treats compound literals as temporaries like any other.