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:
parent
cae39eb41f
commit
44e3e545a3
3 changed files with 21 additions and 1 deletions
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
14
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic7.C
Normal file
14
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic7.C
Normal 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();
|
||||
}
|
Loading…
Add table
Reference in a new issue