http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58516
--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> --- Maybe something like the following might fix it? --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -5199,7 +5199,9 @@ finish_transaction_stmt (tree stmt, tree compound_stmt, int flags, tree noex) { tree body = build_must_not_throw_expr (TRANSACTION_EXPR_BODY (stmt), noex); - SET_EXPR_LOCATION (body, EXPR_LOCATION (TRANSACTION_EXPR_BODY (stmt))); + /* Check that the STATEMENT_LIST is not empty. */ + if (TREE_CODE (TRANSACTION_EXPR_BODY (stmt)) != STATEMENT_LIST) + SET_EXPR_LOCATION (body, EXPR_LOCATION (TRANSACTION_EXPR_BODY (stmt))); TREE_SIDE_EFFECTS (body) = 1; TRANSACTION_EXPR_BODY (stmt) = body; }