[Bug c++/83793] New: Pack expansion outside of lambda containing the pack incorrectly rejected
kretz at kde dot org
gcc-bugzilla@gcc.gnu.org
Thu Jan 11 10:42:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83793
Bug ID: 83793
Summary: Pack expansion outside of lambda containing the pack
incorrectly rejected
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: kretz at kde dot org
Target Milestone: ---
Testcase (https://godbolt.org/g/mNhetZ):
#include <array>
#include <utility>
using std::size_t;
template <size_t... Indexes> auto f(std::index_sequence<Indexes...>) {
std::array<int, sizeof...(Indexes)> x = {[&]() -> int { return Indexes;
}()...};
return x;
}
auto g() {
return f(std::make_index_sequence<3>());
}
The pack expansion of `[&]() -> int { return Indexes; }()` is apparently never
considered. ICC, clang, and MSVC accept the code.
More information about the Gcc-bugs
mailing list