From 2e3897490e0f99b22a2813cfb34d59a1ea71ff68 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 17 Apr 2020 16:59:57 +0200 Subject: c, c++: Fix two redundantAssignment warnings [PR94629] This change fixes two obvious redundant assignments reported by cppcheck: trunk.git/gcc/c/c-parser.c:16969:2: style: Variable 'data.clauses' is reassigned a value before the old one has been used. [redundantAssignment] trunk.git/gcc/cp/call.c:5116:9: style: Variable 'arg2' is reassigned a value before the old one has been used. [redundantAssignment] 2020-04-17 Jakub Jelinek PR other/94629 * c-parser.c (c_parser_oacc_routine): Remove redundant assignment to data.clauses. * call.c (build_conditional_expr_1): Remove redundant assignment to arg2. --- gcc/cp/call.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/cp/call.c') diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 1f3d9d2..c582316 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -5112,7 +5112,7 @@ build_conditional_expr_1 (const op_location_t &loc, /* Make sure that lvalues remain lvalues. See g++.oliva/ext1.C. */ if (glvalue_p (arg1)) { - arg2 = arg1 = cp_stabilize_reference (arg1); + arg1 = cp_stabilize_reference (arg1); arg2 = arg1 = prevent_lifetime_extension (arg1); } else -- cgit v1.1