summaryrefslogtreecommitdiff
path: root/gcc/cp/lambda.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/lambda.c')
-rw-r--r--gcc/cp/lambda.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c
index d4284bfa48b..c48cd5201e0 100644
--- a/gcc/cp/lambda.c
+++ b/gcc/cp/lambda.c
@@ -1029,6 +1029,9 @@ maybe_add_lambda_conv_op (tree type)
tree stattype = build_function_type (fn_result, FUNCTION_ARG_CHAIN (callop));
stattype = (cp_build_type_attribute_variant
(stattype, TYPE_ATTRIBUTES (optype)));
+ if (flag_noexcept_type
+ && TYPE_NOTHROW_P (TREE_TYPE (callop)))
+ stattype = build_exception_variant (stattype, noexcept_true_spec);
/* First build up the conversion op. */