This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/56568] std::initializer_list return value contents lost prematurely


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]