diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/pt.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/gomp/pr58567.C | 15 |
4 files changed, 29 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e89bc50baa8..70211081dbf 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +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> Core DR 1442 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 3b8f83a596c..98d7365a7cc 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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 = RECUR (init); decl = RECUR (decl); + + if (decl == error_mark_node || init == error_mark_node) + return; + if (init_decl) { gcc_assert (!processing_template_decl); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b7639618d19..ebf40341ef5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +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> PR tree-optimization/59651 diff --git a/gcc/testsuite/g++.dg/gomp/pr58567.C b/gcc/testsuite/g++.dg/gomp/pr58567.C new file mode 100644 index 00000000000..35a5bb027ff --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/pr58567.C @@ -0,0 +1,15 @@ +/* { 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>(); +} |