From: Jason Merrill Date: Thu, 1 Apr 2021 19:17:40 +0000 (-0400) Subject: c++: variadic lambda noexcept-specifier [PR99583] X-Git-Tag: upstream/12.2.0~9001 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0cf4813202f19768e31666f6aa82bde4dce4065a;p=platform%2Fupstream%2Fgcc.git 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. --- diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index dca947b..13cc61c 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -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; } diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic12.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic12.C new file mode 100644 index 0000000..6746157 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic12.C @@ -0,0 +1,9 @@ +// PR c++/99583 +// { dg-do compile { target c++11 } } + +void f(...); + +template +void g() { + f([]() noexcept(B) {} ...); +}