re PR c++/59628 (ICE with invalid OpenMP "declare reduction" clause)
/cp 2014-12-12 Paolo Carlini <paolo.carlini@oracle.com> PR c++/59628 * semantics.c (finish_omp_reduction_clause): Early return true if DECL_SAVED_TREE (id) is NULL_TREE. /testsuite 2014-12-12 Paolo Carlini <paolo.carlini@oracle.com> PR c++/59628 * g++.dg/gomp/pr59628.C: New. From-SVN: r218692
This commit is contained in:
parent
d95521b411
commit
88957d5e14
@ -1,3 +1,9 @@
|
||||
2014-12-12 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/59628
|
||||
* semantics.c (finish_omp_reduction_clause): Early return true
|
||||
if DECL_SAVED_TREE (id) is NULL_TREE.
|
||||
|
||||
2014-12-12 Jason Merrill <jason@redhat.com>
|
||||
|
||||
N3922
|
||||
|
@ -5138,6 +5138,8 @@ finish_omp_reduction_clause (tree c, bool *need_default_ctor, bool *need_dtor)
|
||||
id = OVL_CURRENT (id);
|
||||
mark_used (id);
|
||||
tree body = DECL_SAVED_TREE (id);
|
||||
if (!body)
|
||||
return true;
|
||||
if (TREE_CODE (body) == STATEMENT_LIST)
|
||||
{
|
||||
tree_stmt_iterator tsi;
|
||||
|
@ -1,3 +1,8 @@
|
||||
2014-12-12 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/59628
|
||||
* g++.dg/gomp/pr59628.C: New.
|
||||
|
||||
2014-12-12 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/61924
|
||||
|
13
gcc/testsuite/g++.dg/gomp/pr59628.C
Normal file
13
gcc/testsuite/g++.dg/gomp/pr59628.C
Normal file
@ -0,0 +1,13 @@
|
||||
// PR c++/59628
|
||||
// { dg-do compile }
|
||||
// { dg-options "-fopenmp" }
|
||||
|
||||
struct A { int i; };
|
||||
|
||||
void foo()
|
||||
{
|
||||
A a;
|
||||
#pragma omp declare reduction (+: A: omp_out.i +: omp_in.i) // { dg-error "expected" }
|
||||
#pragma omp parallel reduction (+: a)
|
||||
;
|
||||
}
|
Loading…
Reference in New Issue
Block a user