This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/83793] Pack expansion outside of lambda containing the pack incorrectly rejected
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 13 Jan 2018 01:04:43 +0000
- Subject: [Bug c++/83793] Pack expansion outside of lambda containing the pack incorrectly rejected
- Auto-submitted: auto-generated
- References: <bug-83793-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83793
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2018-01-13
CC| |msebor at gcc dot gnu.org
Known to work| |8.0
Ever confirmed|0 |1
Known to fail| |7.2.0
--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
GCC 8 accepts the code without any errors.
Confirmed with 7.2 and the following output (please remember to provide
compiler output with bug reports about wrong diagnostics):
t.C: In lambda function:
t.C:6:68: error: parameter packs not expanded with ‘...’:
std::array<int, sizeof...(Indexes)> x = {[&]() -> int { return Indexes;
}()...};
^~~~~~~
t.C:6:68: note: ‘Indexes’
t.C: In function ‘auto f(std::index_sequence<Indexes ...>)’:
t.C:6:80: error: expansion pattern ‘<lambda>()’ contains no argument packs
td::array<int, sizeof...(Indexes)> x = {[&]() -> int { return Indexes;
}()...};
^~~
There have been many changes in lambda support in GCC 8. I'm not sure which
one of them has fixed it or whether it would be feasible to backport it to 7.x.
My guess is that it's unlikely.