diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-06-17 02:28:18 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-06-17 02:28:18 +0000 |
commit | 23f59d67bd87b44cd27fb2cb779acf284daaab05 (patch) | |
tree | cd623ba15f2144a7d523bda6db25843c5d18e963 /gcc/cp/lambda.c | |
parent | c2ca6e199d6cd80e04c17e26bb98dfb3086b6012 (diff) | |
download | gcc-23f59d67bd87b44cd27fb2cb779acf284daaab05.tar.gz |
PR c++/80465 - ICE with generic lambda with noexcept-specifier.
* lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
set longer for a generic lambda.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249322 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/lambda.c')
-rw-r--r-- | gcc/cp/lambda.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c index ee8784cb6ad..41d4921c1db 100644 --- a/gcc/cp/lambda.c +++ b/gcc/cp/lambda.c @@ -987,6 +987,8 @@ maybe_add_lambda_conv_op (tree type) null_pointer_node); if (generic_lambda_p) { + ++processing_template_decl; + /* Prepare the dependent member call for the static member function '_FUN' and, potentially, prepare another call to be used in a decltype return expression for a deduced return call op to allow for simple @@ -1036,9 +1038,7 @@ maybe_add_lambda_conv_op (tree type) if (generic_lambda_p) { - ++processing_template_decl; tree a = forward_parm (tgt); - --processing_template_decl; CALL_EXPR_ARG (call, ix) = a; if (decltype_call) @@ -1062,11 +1062,9 @@ maybe_add_lambda_conv_op (tree type) { if (decltype_call) { - ++processing_template_decl; fn_result = finish_decltype_type (decltype_call, /*id_expression_or_member_access_p=*/false, tf_warning_or_error); - --processing_template_decl; } } else @@ -1084,6 +1082,9 @@ maybe_add_lambda_conv_op (tree type) && TYPE_NOTHROW_P (TREE_TYPE (callop))) stattype = build_exception_variant (stattype, noexcept_true_spec); + if (generic_lambda_p) + --processing_template_decl; + /* First build up the conversion op. */ tree rettype = build_pointer_type (stattype); |