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++. --- Comment #14 from Paul Pluzhnikov <ppluzhnikov at google dot com> 2012-05-22 17:50:07 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 should 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++.