aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2015-10-07 06:52:45 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2015-10-07 06:52:45 +0000
commit5b5dce39b8c076c185ce1fa19d4800d6129f3f53 (patch)
treeadefe0417cb5fcc10eaf977e1ba8716919e63640 /gcc/cp/semantics.c
parent00852255e4a0d3b67ed853aacbc4aa4f4dfe724a (diff)
downloadgcc-5b5dce39b8c076c185ce1fa19d4800d6129f3f53.zip
gcc-5b5dce39b8c076c185ce1fa19d4800d6129f3f53.tar.gz
gcc-5b5dce39b8c076c185ce1fa19d4800d6129f3f53.tar.bz2
cp-gimplify.c (genericize_if_stmt): Use protected_set_expr_location.
* cp-gimplify.c (genericize_if_stmt): Use protected_set_expr_location. (genericize_cp_loop): Likewise. * decl.c (cxx_maybe_build_cleanup): Likewise. * parser.c (cp_parser_binary_expression): Likewise. (cp_parser_omp_for_loop): Likewise. (cp_parser_omp_construct): Likewise. * semantics.c (finish_transaction_stmt): Likewise. (build_transaction_expr): Likewise. From-SVN: r228560
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index ea40398..c1f4330 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -7086,9 +7086,8 @@ finish_transaction_stmt (tree stmt, tree compound_stmt, int flags, tree noex)
{
tree body = build_must_not_throw_expr (TRANSACTION_EXPR_BODY (stmt),
noex);
- /* 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)));
+ protected_set_expr_location
+ (body, EXPR_LOCATION (TRANSACTION_EXPR_BODY (stmt)));
TREE_SIDE_EFFECTS (body) = 1;
TRANSACTION_EXPR_BODY (stmt) = body;
}
@@ -7108,8 +7107,7 @@ build_transaction_expr (location_t loc, tree expr, int flags, tree noex)
if (noex)
{
expr = build_must_not_throw_expr (expr, noex);
- if (EXPR_P (expr))
- SET_EXPR_LOCATION (expr, loc);
+ protected_set_expr_location (expr, loc);
TREE_SIDE_EFFECTS (expr) = 1;
}
ret = build1 (TRANSACTION_EXPR, TREE_TYPE (expr), expr);