PR c++/86200 - ICE with unexpanded pack in lambda parameter.

* pt.c (find_parameter_packs_r) [LAMBDA_EXPR]: Also look into the
	function type.

From-SVN: r261726
This commit is contained in:
Jason Merrill 2018-06-18 20:38:32 -04:00 committed by Jason Merrill
parent cae39eb41f
commit 44e3e545a3
3 changed files with 21 additions and 1 deletions

View file

@ -1,5 +1,9 @@
2018-06-18 Jason Merrill <jason@redhat.com>
PR c++/86200 - ICE with unexpanded pack in lambda parameter.
* pt.c (find_parameter_packs_r) [LAMBDA_EXPR]: Also look into the
function type.
PR c++/81060 - ICE with unexpanded parameter pack.
* pt.c (check_for_bare_parameter_packs): Add loc parameter.
* decl.c (grokdeclarator): Call it for qualifying_scope.

View file

@ -3839,8 +3839,10 @@ find_parameter_packs_r (tree *tp, int *walk_subtrees, void* data)
cap; cap = TREE_CHAIN (cap))
cp_walk_tree (&TREE_VALUE (cap), &find_parameter_packs_r, ppd,
ppd->visited);
/* Since we defer implicit capture, look in the body as well. */
/* Since we defer implicit capture, look in the parms and body. */
tree fn = lambda_function (t);
cp_walk_tree (&TREE_TYPE (fn), &find_parameter_packs_r, ppd,
ppd->visited);
cp_walk_tree (&DECL_SAVED_TREE (fn), &find_parameter_packs_r, ppd,
ppd->visited);
*walk_subtrees = 0;

View file

@ -0,0 +1,14 @@
// PR c++/86200
// { dg-do compile { target c++11 } }
template<typename ... Args>
static void foo()
{
[](Args, int x) {
x;
}; // { dg-error "packs not expanded" }
}
int main()
{
foo();
}