https://gcc.gnu.org/g:f952aa237c17cb6cf2478d0e77e718c225c8696f

commit r15-11217-gf952aa237c17cb6cf2478d0e77e718c225c8696f
Author: Jakub Jelinek <[email protected]>
Date:   Wed Apr 8 15:37:09 2026 +0200

    c++, openmp: Fix copy-paste bug wrote to incrv instead of orig_declv
    
    gcc/cp/ChangeLog:
            * parser.cc (cp_parser_omp_loop_nest): Write orig_declv, not incrv.
    
    Signed-off-by: Yang Kun <[email protected]>
    (cherry picked from commit e52b9f566bf0af9c7b0d284ad73f49ac82f6a515)

Diff:
---
 gcc/cp/parser.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc
index 703ca23796c3..97d17da1d1b9 100644
--- a/gcc/cp/parser.cc
+++ b/gcc/cp/parser.cc
@@ -46429,7 +46429,7 @@ cp_parser_omp_loop_nest (cp_parser *parser, bool *if_p)
          TREE_VEC_ELT (omp_for_parse_state->condv, depth) = NULL_TREE;
          TREE_VEC_ELT (omp_for_parse_state->incrv, depth) = NULL_TREE;
          if (omp_for_parse_state->orig_declv)
-           TREE_VEC_ELT (omp_for_parse_state->incrv, depth) = NULL_TREE;
+           TREE_VEC_ELT (omp_for_parse_state->orig_declv, depth) = NULL_TREE;
          vec_safe_push (omp_for_parse_state->init_blockv, NULL_TREE);
          vec_safe_push (omp_for_parse_state->body_blockv, NULL_TREE);
          vec_safe_push (omp_for_parse_state->init_placeholderv, NULL_TREE);

Reply via email to