[Bug libstdc++/80172] Segfault when using a constructed intializer list of tuple(int, variant) created through template pack expansion

2017-03-27 Thread gcc-bugs at marehr dot dialup.fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80172

--- Comment #3 from gcc-bugs at marehr dot dialup.fu-berlin.de ---
Thank you for your feedback!

With std::array it works without a problem :)

[Bug libstdc++/80172] Segfault when using a constructed intializer list of tuple(int, variant) created through template pack expansion

2017-03-27 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80172

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #2 from Jonathan Wakely  ---
Not a bug.

[Bug libstdc++/80172] Segfault when using a constructed intializer list of tuple(int, variant) created through template pack expansion

2017-03-24 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80172

--- Comment #1 from Jonathan Wakely  ---
I don't think this is valid code, that's not how std::initializer_list works.
It's not a magic array that owns its contents, it's just a pointer to some
external array and a length. In your functions the array is a local variable
inside the function, and you return a dangling initializer_list object that
refers to the local array.

If you return std::array it works fine.