c++: variadic lambda noexcept-specifier [PR99583]

The tree-walk looking for parameter packs didn't find this one because we
weren't stepping into TYPE_RAISES_EXCEPTIONS.

gcc/cp/ChangeLog:

	PR c++/99583
	PR c++/99584
	* tree.c (cp_walk_subtrees) [FUNCTION_TYPE]: Walk into
	TYPE_RAISES_EXCEPTIONS.

gcc/testsuite/ChangeLog:

	PR c++/99583
	* g++.dg/cpp0x/lambda/lambda-variadic12.C: New test.
This commit is contained in:
Jason Merrill 2021-04-01 15:17:40 -04:00
parent af78514a18
commit 0cf4813202
2 changed files with 14 additions and 0 deletions

View File

@ -5415,6 +5415,11 @@ cp_walk_subtrees (tree *tp, int *walk_subtrees_p, walk_tree_fn func,
}
break;
case FUNCTION_TYPE:
case METHOD_TYPE:
WALK_SUBTREE (TYPE_RAISES_EXCEPTIONS (*tp));
break;
default:
return NULL_TREE;
}

View File

@ -0,0 +1,9 @@
// PR c++/99583
// { dg-do compile { target c++11 } }
void f(...);
template <bool... B>
void g() {
f([]() noexcept(B) {} ...);
}