https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71223
Bug ID: 71223 Summary: [fold expression] Incorrect processing a fold expression Product: gcc Version: 6.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: sergstrukovlink at gmail dot com Target Milestone: --- Created attachment 38539 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38539&action=edit example In the attached example compiler fails to compile the following line Test2<short,int,long>(); // emits error If I change the definition of template <class T> using AddType = TypeBox<T> ; // int to template <class T> using AddType = int ; the error disappeares. main.cpp: In instantiation of 'struct Test2<short int, int, long int>': main.cpp:41:25: required from here main.cpp:23:74: error: invalid use of pack expansion expression using IndexList = decltype( ( IndexListBox<>() + ... + AddType<TT>() ) ) ; ^ make: *** [main.o] Error 1