https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94326
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
--- gcc/cp/call.c.jj 2020-03-25 08:05:07.153731580 +0100
+++ gcc/cp/call.c 2020-03-26 15:03:42.432909693 +0100
@@ -333,11 +333,14 @@ set_flags_from_callee (tree call)
&& internal_fn_flags (CALL_EXPR_IFN (call)) & ECF_NOTHROW)
nothrow = true;
- if (!nothrow && at_function_scope_p () && cfun && cp_function_chain)
- cp_function_chain->can_throw = 1;
+ if (cfun && cp_function_chain && !cp_unevaluated_operand)
+ {
+ if (!nothrow && at_function_scope_p ())
+ cp_function_chain->can_throw = 1;
- if (decl && TREE_THIS_VOLATILE (decl) && cfun && cp_function_chain)
- current_function_returns_abnormally = 1;
+ if (decl && TREE_THIS_VOLATILE (decl))
+ current_function_returns_abnormally = 1;
+ }
TREE_NOTHROW (call) = nothrow;
}
seems to work, but not sure if that is what we want.