This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/56568] std::initializer_list return value contents lost prematurely
- From: "potswa at mac dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 04 Sep 2015 00:25:54 +0000
- Subject: [Bug c++/56568] std::initializer_list return value contents lost prematurely
- Auto-submitted: auto-generated
- References: <bug-56568-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56568
--- Comment #5 from David Krauss <potswa at mac dot com> ---
(In reply to fuzzyTew from comment #4)
The original testcase is invalid. initializer_list is special in that it
behaves like a reference, so adding && doesn't make a difference.
I'm working on an ISO proposal (http://bit.ly/genlife) to fix some such cases
in C++17, but all it would do for return values is allow the compiler to
produce a warning. The way initializer_list works, the sequence is
intrinsically incapable of escaping the current scope, much less the current
function.