https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68396
Bug ID: 68396 Summary: bug with parameter pack expansion Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ryan.burn at gmail dot com Target Milestone: --- This valid code below worked until recently with gcc-6. The latest version of gcc-6 gives the incorrect error: bug2.cpp: In function ‘auto make_dimensionality_impl()’: bug2.cpp:7:17: error: parameter packs not expanded with ‘...’: return get<2>(); ^ bug2.cpp:7:17: note: ‘auto’ //////////////////////////////////////////////////////////////////// template <unsigned> auto get() { return 2; }; template <class> class Dimensionality {}; template <int... Indexes> auto make_dimensionality_impl() { Dimensionality<decltype(get<Indexes>())...>(); return get<2>(); } int main() { return 0; } ////////////////////////////////////////////////////////////////////