Commit 9d620422 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/84791 (ICE with broken OpenMP reduction clause)

	PR c++/84791
	* semantics.c (finish_omp_reduction_clause): If
	OMP_CLAUSE_REDUCTION_PLACEHOLDER is error_mark_node, return true
	even if processing_template_decl.

	* g++.dg/gomp/pr84791.C: New test.

From-SVN: r258981
parent 85d36775
2018-03-30 Jakub Jelinek <jakub@redhat.com>
PR c++/84791
* semantics.c (finish_omp_reduction_clause): If
OMP_CLAUSE_REDUCTION_PLACEHOLDER is error_mark_node, return true
even if processing_template_decl.
2018-03-29 David Malcolm <dmalcolm@redhat.com> 2018-03-29 David Malcolm <dmalcolm@redhat.com>
PR c++/84269 PR c++/84269
......
...@@ -5623,7 +5623,11 @@ finish_omp_reduction_clause (tree c, bool *need_default_ctor, bool *need_dtor) ...@@ -5623,7 +5623,11 @@ finish_omp_reduction_clause (tree c, bool *need_default_ctor, bool *need_dtor)
return false; return false;
} }
else if (processing_template_decl) else if (processing_template_decl)
return false; {
if (OMP_CLAUSE_REDUCTION_PLACEHOLDER (c) == error_mark_node)
return true;
return false;
}
tree id = OMP_CLAUSE_REDUCTION_PLACEHOLDER (c); tree id = OMP_CLAUSE_REDUCTION_PLACEHOLDER (c);
......
2018-03-30 Jakub Jelinek <jakub@redhat.com>
PR c++/84791
* g++.dg/gomp/pr84791.C: New test.
2018-03-30 Paul Thomas <pault@gcc.gnu.org> 2018-03-30 Paul Thomas <pault@gcc.gnu.org>
PR fortran/84931 PR fortran/84931
......
// PR c++/84791
// { dg-do compile }
typedef int I;
template <int>
void
foo ()
{
I i;
#pragma omp parallel reduction (I::I: i) // { dg-error "'I' is not a class, namespace, or enumeration" "" { target c++11 } }
; // { dg-error "'I' is not a class or namespace" "" { target c++98_only } .-1 }
}
template void foo<0> ();
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