2018-01-26 Jason Merrill <jason@redhat.com>
+ PR c++/84036 - ICE with variadic capture.
+ PR c++/82249
+ * pt.c (tsubst_pack_expansion): When optimizing a simple
+ substitution, pull a single pack expansion out of its pack.
+
PR c++/82514 - ICE with local class in generic lambda.
* pt.c (regenerated_lambda_fn_p): Remove.
(enclosing_instantiation_of): Don't use it.
&& TREE_PURPOSE (packs) == pattern)
{
tree args = ARGUMENT_PACK_ARGS (TREE_VALUE (packs));
+
+ /* If the argument pack is a single pack expansion, pull it out. */
+ if (TREE_VEC_LENGTH (args) == 1
+ && pack_expansion_args_count (args))
+ return TREE_VEC_ELT (args, 0);
+
/* Types need no adjustment, nor does sizeof..., and if we still have
some pack expansion args we won't do anything yet. */
if (TREE_CODE (t) == TYPE_PACK_EXPANSION