https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125282
--- Comment #3 from feedable <feedabl3 at gmail dot com> --- (In reply to Fedor Chelnokov from comment #2) > Another testcase for the same function (https://gcc.godbolt.org/z/x93rnnGxG): > ``` > struct x {}; > template<int = 0> > void foo() { ([]{ auto [...xs] = x{}; xs; }, ...); } > template void foo<>(); > // internal compiler error: Segmentation fault > // tsubst_pack_expansion(tree_node*, tree_node*, int, tree_node*) > // instantiate_decl(tree_node*, bool, bool) > ``` > Differences from comment 0: the pack is not named in the RHS of its own > binding, the initializer is not involved — tsubst_pack_expansion is reached > straight from instantiate_decl rather than through > tsubst_init/tsubst_call_args — and it is a segfault rather than the assert. > 16.1 and trunk alike. > > Replacing `xs;` with anything that does not name the pack unexpanded — `(xs, > ...);`, `static_assert(sizeof...(xs) == 0);`, or nothing at all — gives the > correct "operand of fold expression has no unexpanded parameter packs"; same > for pack expansion in a call argument or in a braced initializer list. > > Clang crashes on the same shape: > https://github.com/llvm/llvm-project/issues/214160 That's filed as https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126124, I think.
