Commit 44e3e545 by Jason Merrill Committed by Jason Merrill

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
parent cae39eb4
2018-06-18 Jason Merrill <jason@redhat.com> 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. PR c++/81060 - ICE with unexpanded parameter pack.
* pt.c (check_for_bare_parameter_packs): Add loc parameter. * pt.c (check_for_bare_parameter_packs): Add loc parameter.
* decl.c (grokdeclarator): Call it for qualifying_scope. * decl.c (grokdeclarator): Call it for qualifying_scope.
......
...@@ -3839,8 +3839,10 @@ find_parameter_packs_r (tree *tp, int *walk_subtrees, void* data) ...@@ -3839,8 +3839,10 @@ find_parameter_packs_r (tree *tp, int *walk_subtrees, void* data)
cap; cap = TREE_CHAIN (cap)) cap; cap = TREE_CHAIN (cap))
cp_walk_tree (&TREE_VALUE (cap), &find_parameter_packs_r, ppd, cp_walk_tree (&TREE_VALUE (cap), &find_parameter_packs_r, ppd,
ppd->visited); 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); 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, cp_walk_tree (&DECL_SAVED_TREE (fn), &find_parameter_packs_r, ppd,
ppd->visited); ppd->visited);
*walk_subtrees = 0; *walk_subtrees = 0;
......
// 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();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment