@@ -5199,7 +5199,9 @@ finish_transaction_stmt (tree stmt, tree
{
tree body = build_must_not_throw_expr (TRANSACTION_EXPR_BODY (stmt),
noex);
- SET_EXPR_LOCATION (body, EXPR_LOCATION (TRANSACTION_EXPR_BODY (stmt)));
+ /* This may not be true when the STATEMENT_LIST is empty. */
+ if (EXPR_P (body))
+ SET_EXPR_LOCATION (body, EXPR_LOCATION (TRANSACTION_EXPR_BODY (stmt)));
TREE_SIDE_EFFECTS (body) = 1;
TRANSACTION_EXPR_BODY (stmt) = body;
}
@@ -0,0 +1,7 @@
+// { dg-do compile }
+// { dg-options "-std=c++11 -fgnu-tm" }
+
+void foo()
+{
+ __transaction_atomic noexcept(false) {}
+}