Commit 54a990d3 by Tobias Burnus Committed by Tobias Burnus

re PR c++/58567 (ICE with invalid loop variable in template using openmp)

2014-01-03  Tobias Burnus  <burnus@net-b.de>

        PR c++/58567
        * pt.c (tsubst_omp_for_iterator): Early return for
        * error_mark_node.


2014-01-03  Tobias Burnus  <burnus@net-b.de>

        PR c++/58567
        * g++.dg/gomp/pr58567.C: New.

From-SVN: r206322
parent 82d89471
2014-01-03 Tobias Burnus <burnus@net-b.de>
PR c++/58567
* pt.c (tsubst_omp_for_iterator): Early return for error_mark_node.
2014-01-03 Paolo Carlini <paolo.carlini@oracle.com> 2014-01-03 Paolo Carlini <paolo.carlini@oracle.com>
Core DR 1442 Core DR 1442
......
...@@ -13035,6 +13035,10 @@ tsubst_omp_for_iterator (tree t, int i, tree declv, tree initv, ...@@ -13035,6 +13035,10 @@ tsubst_omp_for_iterator (tree t, int i, tree declv, tree initv,
init_decl = (init && TREE_CODE (init) == DECL_EXPR); init_decl = (init && TREE_CODE (init) == DECL_EXPR);
init = RECUR (init); init = RECUR (init);
decl = RECUR (decl); decl = RECUR (decl);
if (decl == error_mark_node || init == error_mark_node)
return;
if (init_decl) if (init_decl)
{ {
gcc_assert (!processing_template_decl); gcc_assert (!processing_template_decl);
......
2014-01-03 Tobias Burnus <burnus@net-b.de>
PR c++/58567
* g++.dg/gomp/pr58567.C: New.
2014-01-03 Bingfeng Mei <bmei@broadcom.com> 2014-01-03 Bingfeng Mei <bmei@broadcom.com>
PR tree-optimization/59651 PR tree-optimization/59651
......
/* { dg-do compile } */
/* PR c++/58567 - was ICEing before */
template<typename T> void foo()
{
#pragma omp parallel for
for (typename T::X i = 0; i < 100; ++i) /* { dg-error "'int' is not a class, struct, or union type|expected iteration declaration or initialization" } */
;
}
void bar()
{
foo<int>();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment