diff options
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r-- | gcc/cp/pt.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index efc69d5..07b9956 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -17449,7 +17449,16 @@ tsubst_omp_for_iterator (tree t, int i, tree declv, tree &orig_declv, else decl = RECUR (decl); } - init = RECUR (init); + if (init && TREE_CODE (init) == TREE_VEC) + { + init = copy_node (init); + TREE_VEC_ELT (init, 0) + = tsubst_decl (TREE_VEC_ELT (init, 0), args, complain); + TREE_VEC_ELT (init, 1) = RECUR (TREE_VEC_ELT (init, 1)); + TREE_VEC_ELT (init, 2) = RECUR (TREE_VEC_ELT (init, 2)); + } + else + init = RECUR (init); if (orig_declv && OMP_FOR_ORIG_DECLS (t)) { @@ -17501,7 +17510,21 @@ tsubst_omp_for_iterator (tree t, int i, tree declv, tree &orig_declv, if (!range_for) { - cond = RECUR (TREE_VEC_ELT (OMP_FOR_COND (t), i)); + cond = TREE_VEC_ELT (OMP_FOR_COND (t), i); + if (COMPARISON_CLASS_P (cond) + && TREE_CODE (TREE_OPERAND (cond, 1)) == TREE_VEC) + { + tree lhs = RECUR (TREE_OPERAND (cond, 0)); + tree rhs = copy_node (TREE_OPERAND (cond, 1)); + TREE_VEC_ELT (rhs, 0) + = tsubst_decl (TREE_VEC_ELT (rhs, 0), args, complain); + TREE_VEC_ELT (rhs, 1) = RECUR (TREE_VEC_ELT (rhs, 1)); + TREE_VEC_ELT (rhs, 2) = RECUR (TREE_VEC_ELT (rhs, 2)); + cond = build2 (TREE_CODE (cond), TREE_TYPE (cond), + lhs, rhs); + } + else + cond = RECUR (cond); incr = TREE_VEC_ELT (OMP_FOR_INCR (t), i); if (TREE_CODE (incr) == MODIFY_EXPR) { |