@@ -5189,7 +5189,7 @@ finish_transaction_stmt (tree stmt, tree compound_stmt, int flags, tree noex)
/* noexcept specifications are not allowed for function transactions. */
gcc_assert (!(noex && compound_stmt));
- if (noex)
+ if (noex && flag_exceptions)
{
tree body = build_must_not_throw_expr (TRANSACTION_EXPR_BODY (stmt),
noex);
@@ -5210,7 +5210,7 @@ tree
build_transaction_expr (location_t loc, tree expr, int flags, tree noex)
{
tree ret;
- if (noex)
+ if (noex && flag_exceptions)
{
expr = build_must_not_throw_expr (expr, noex);
SET_EXPR_LOCATION (expr, loc);