http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60146
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I've tried:
--- pt.c.jj3 2014-02-12 17:46:47.000000000 +0100
+++ pt.c 2014-02-17 19:22:36.617413387 +0100
@@ -13057,10 +13057,28 @@ tsubst_omp_for_iterator (tree t, int i,
init = TREE_OPERAND (init, 1);
/* Do this before substituting into decl to handle 'auto'. */
init_decl = (init && TREE_CODE (init) == DECL_EXPR);
- init = RECUR (init);
- decl = RECUR (decl);
+ decl = tsubst (decl, args, complain, in_decl);
+ if (decl == error_mark_node)
+ return;
+
+ if (decl != error_mark_node
+ && !CLASS_TYPE_P (TREE_TYPE (decl))
+ && init_decl)
+ {
+ tree old_decl = DECL_EXPR_DECL (init);
+ tree initial = DECL_INITIAL (old_decl);
+ DECL_INITIAL (old_decl) = NULL_TREE;
+ init = RECUR (init);
+ DECL_INITIAL (old_decl) = initial;
+ if (init == error_mark_node)
+ return;
+ init = RECUR (initial);
+ init_decl = false;
+ }
+ else
+ init = RECUR (init);
- if (decl == error_mark_node || init == error_mark_node)
+ if (init == error_mark_node)
return;
if (init_decl)
but that breaks libgomp.c++/for-2.C test, so I'm stuck.