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: "ppluzhnikov at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 22 May 2012 17:49:24 +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 #13 from Paul Pluzhnikov <ppluzhnikov at google dot com> 2012-05-22 17:49:24 UTC ---
(In reply to comment #12)
> So yes, what remains for this bug is to complain about undefined behavior due
> to accessing the value of an object after its lifetime has ended.
The documentation here:
http://gcc.gnu.org/onlinedocs/gcc/Compound-Literals.html
sould probably be updated to mention that the "You can also construct an
array" part only works in C, and leads to undefined behavior in C++.