aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.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/parser.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/parser.c')
-rw-r--r--gcc/cp/parser.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index f9b668a..d4ef7f9 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -8612,8 +8612,7 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p,
rhs, rhs_type, &overload,
complain_flags (decltype_p));
current.lhs_type = current.tree_type;
- if (EXPR_P (current.lhs))
- SET_EXPR_LOCATION (current.lhs, current.loc);
+ protected_set_expr_location (current.lhs, current.loc);
/* If the binary operator required the use of an overloaded operator,
then this expression cannot be an integral constant-expression.
@@ -32046,8 +32045,8 @@ cp_parser_omp_for_loop (cp_parser *parser, enum tree_code code, tree clauses,
incr = cp_parser_omp_for_incr (parser, real_decl);
else
incr = cp_parser_expression (parser);
- if (CAN_HAVE_LOCATION_P (incr) && !EXPR_HAS_LOCATION (incr))
- SET_EXPR_LOCATION (incr, input_location);
+ if (!EXPR_HAS_LOCATION (incr))
+ protected_set_expr_location (incr, input_location);
}
if (!cp_parser_require (parser, CPP_CLOSE_PAREN, RT_CLOSE_PAREN))
@@ -34045,8 +34044,7 @@ cp_parser_omp_construct (cp_parser *parser, cp_token *pragma_tok)
gcc_unreachable ();
}
- if (stmt)
- SET_EXPR_LOCATION (stmt, pragma_tok->location);
+ protected_set_expr_location (stmt, pragma_tok->location);
}
/* Transactional Memory parsing routines. */