Since version 7 to trunk, the following code no longer compiles (https://godbolt.org/z/_j5EUA) template<class...> struct list{}; template<int n> struct _func_select { using f = void; }; struct func { template<class... seqs> using f = typename _func_select<sizeof...(seqs)>::f; }; template<class... T> func::f<list<T>...> foo(T&&...) {} int main() { foo(); }
*** Bug 95299 has been marked as a duplicate of this bug. ***
Started with r7-2030.
GCC 9.4 is being released, retargeting bugs to GCC 9.5.
GCC 9 branch is being closed
GCC 10.4 is being released, retargeting bugs to GCC 10.5.
This still fails in 12.2 and recent trunk: https://godbolt.org/z/vebz3T6sh I also encountered - sorry, unimplemented: mangling reference_type - sorry, unimplemented: mangling typename_type on heavily templated code. In the first case, transforming a function with signature > template<typename... Types> > constexpr auto foo(Types&&... args) -> tuple<std::unwrap_ref_decay_t<Types>...> into > template<typename... Types> > constexpr auto foo(Types&&... args) -> decltype(auto) made the compilation error go away. In the second case, the similar transformation from > template<typename... Types> > constexpr auto bar(Types&&... args) noexcept -> tuple<Types&&...> to > template<typename... Types> > constexpr auto bar(Types&&... args) noexcept -> decltype(auto) helped. In a reduced example, I wasn't immediately able to reproduce the issue though. If it helps, I will invest more time to reduce my failing code to a reasonable-size reproduction.
GCC 10 branch is being closed.
The trunk branch has been updated by Jason Merrill <jason@gcc.gnu.org>: https://gcc.gnu.org/g:d26f589e61a178e898d8b247042b487287ffe121 commit r14-6797-gd26f589e61a178e898d8b247042b487287ffe121 Author: Jason Merrill <jason@redhat.com> Date: Sat Nov 18 14:35:22 2023 -0500 c++: sizeof... mangling with alias template [PR95298] We were getting sizeof... mangling wrong when the argument after substitution was a pack expansion that is not a simple T..., such as list<T>... in variadic-mangle4.C or (A+1)... in variadic-mangle5.C. In the former case we ICEd; in the latter case we wrongly mangled it as sZ <expression>. PR c++/95298 gcc/cp/ChangeLog: * mangle.cc (write_expression): Handle v18 sizeof... bug. * pt.cc (tsubst_pack_expansion): Keep TREE_VEC for sizeof... (tsubst_expr): Don't strip TREE_VEC here. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/variadic-mangle2.C: Add non-member. * g++.dg/cpp0x/variadic-mangle4.C: New test. * g++.dg/cpp0x/variadic-mangle5.C: New test. * g++.dg/cpp0x/variadic-mangle5a.C: New test.