From: paolo Date: Wed, 29 Jan 2014 13:36:22 +0000 (+0000) Subject: /cp X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dac04683609bbfab18269672ade4b2554c60a16e;p=thirdparty%2Fgcc.git /cp 2014-01-29 Paolo Carlini PR c++/58702 * semantics.c (finish_omp_reduction_clause): Check type for error_mark_node. /testsuite 2014-01-29 Paolo Carlini PR c++/58702 * g++.dg/gomp/pr58702.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207235 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 31217e76c537..3ed0ef8da7fc 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2014-01-29 Paolo Carlini + + PR c++/58702 + * semantics.c (finish_omp_reduction_clause): Check type for + error_mark_node. + 2014-01-28 Jason Merrill PR c++/59791 diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index fd6466da6a56..9fb4fc0c692d 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -5021,7 +5021,9 @@ finish_omp_reduction_clause (tree c, bool *need_default_ctor, bool *need_dtor) tree type = TREE_TYPE (t); if (TREE_CODE (type) == REFERENCE_TYPE) type = TREE_TYPE (type); - if (ARITHMETIC_TYPE_P (type)) + if (type == error_mark_node) + return true; + else if (ARITHMETIC_TYPE_P (type)) switch (OMP_CLAUSE_REDUCTION_CODE (c)) { case PLUS_EXPR: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 27777da23c80..1e8f971300fb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-01-29 Paolo Carlini + + PR c++/58702 + * g++.dg/gomp/pr58702.C: New. + 2014-01-29 Dodji Seketeli * c-c++-common/cpp/warning-zero-location-2.c: Fix error message diff --git a/gcc/testsuite/g++.dg/gomp/pr58702.C b/gcc/testsuite/g++.dg/gomp/pr58702.C new file mode 100644 index 000000000000..5bab86118baa --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/pr58702.C @@ -0,0 +1,10 @@ +// PR c++/58702 +// { dg-do compile } +// { dg-options "-fopenmp" } + +void foo() +{ + x; // { dg-error "was not declared" } +#pragma omp parallel for reduction(+:x) + for (int i = 0; i < 10; ++i) ; +}