From: Tobias Burnus Date: Mon, 14 Jun 2021 14:49:24 +0000 (+0200) Subject: C/C++: Fix unused set var warning with omp_clause_affinity [PR100913] X-Git-Tag: basepoints/gcc-13~6880 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12d13cf50fe68c898ee65d71d1ba9cdb3ea07996;p=thirdparty%2Fgcc.git C/C++: Fix unused set var warning with omp_clause_affinity [PR100913] PR c/100913 gcc/c/ChangeLog: * c-parser.c (c_parser_omp_clause_affinity): No need to set iterator var in the error case. gcc/cp/ChangeLog: * parser.c (cp_parser_omp_clause_affinity): No need to set iterator var in the error case. --- diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index add33532a608..b90710cba2f8 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -15596,9 +15596,7 @@ c_parser_omp_clause_affinity (c_parser *parser, tree list) if (iterators) { tree block = pop_scope (); - if (iterators == error_mark_node) - iterators = NULL_TREE; - else + if (iterators != error_mark_node) { TREE_VEC_ELT (iterators, 5) = block; for (tree c = nl; c != list; c = OMP_CLAUSE_CHAIN (c)) diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index b5af3877e488..d57ddc4560df 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -37928,9 +37928,7 @@ cp_parser_omp_clause_affinity (cp_parser *parser, tree list) if (iterators) { tree block = poplevel (1, 1, 0); - if (iterators == error_mark_node) - iterators = NULL_TREE; - else + if (iterators != error_mark_node) { TREE_VEC_ELT (iterators, 5) = block; for (c = nlist; c != list; c = OMP_CLAUSE_CHAIN (c))