https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81975
Bug ID: 81975 Summary: Unpacking two packs via alias erroneously complains about mismatched argument packs Product: gcc Version: 7.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Example slightly reduced from http://lists.isocpp.org/core/2017/08/2827.php: template <class T, class U> struct is_same; struct make_list { template <typename... Ts> using f = void; }; template<template <typename, typename> class F, typename... Ts> struct zip_with { #ifdef ALIAS template <typename C, typename... Ss> using continuation_t = typename C::template f<F<Ts, Ss>...>; #else template <typename C, typename... Ss> struct continuation { using type = typename C::template f<F<Ts, Ss>...>; }; template <typename C, typename... Ss> using continuation_t = typename continuation<C, Ss...>::type; #endif template<typename... Ss> using f = continuation_t<make_list, Ss...>; }; using T = zip_with<is_same>::f<>; using U = zip_with<is_same, int>::f<int>; using V = zip_with<is_same, int, int>::f<int, int>; Compiling with -DALIAS works fine. Compiling without it leads to errors for T and V (but not U!) about mismatched argument pack lengths while expanding F<Ts,Ss>. The two formulations should be equivalent.