https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66786
Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEW Assignee|mpolacek at gcc dot gnu.org |unassigned at gcc dot gnu.org --- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> --- Unfortunately, I'll have to give up on this one. What happens here is that we ICE because we have a lambda expr, whose LAMBDA_EXPR_CAPTURE_LIST has null TREE_PURPOSE. 10272 /* We need to instantiate the capture list from the template 10273 after we've instantiated the closure members, but before we 10274 consider adding the conversion op. Also keep any captures 10275 that may have been added during instantiation of the op(). */ 10276 tree tmpl_expr = CLASSTYPE_LAMBDA_EXPR (pattern); 10277 tree tmpl_cap 10278 = tsubst_copy_and_build (LAMBDA_EXPR_CAPTURE_LIST (tmpl_expr), 10279 args, tf_warning_or_error, NULL_TREE, 10280 false, false); 10281 10282 LAMBDA_EXPR_CAPTURE_LIST (expr) 10283 = chainon (tmpl_cap, nreverse (LAMBDA_EXPR_CAPTURE_LIST (expr))); but tsubst_copy_and_build returns tmpl_cap without TREE_PURPOSE, because 16621 /* Expand the argument expressions. */ 16622 if (TREE_PURPOSE (t)) 16623 purposevec = tsubst_pack_expansion (TREE_PURPOSE (t), args, 16624 complain, in_decl); returns null. That is probably because we end up calling 13898 /* Otherwise return the full NONTYPE_ARGUMENT_PACK that 13899 tsubst_decl put in the hash table. */ 13900 return retrieve_specialization (t, args, 0); which is where the null originates. Alas, this pt.c maze is something I can't figure out, so unassigning :(.