re PR c++/91110 (ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in cp_omp_mappable_type_1, at cp/decl2.c:1421)

PR c++/91110
	* decl2.c (cp_omp_mappable_type_1): Don't emit any note for
	error_mark_node type.

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

From-SVN: r273248
This commit is contained in:
Jakub Jelinek 2019-07-09 00:08:27 +02:00 committed by Jakub Jelinek
parent 079e0f6196
commit 9c6e2f8274
4 changed files with 23 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2019-07-08 Jakub Jelinek <jakub@redhat.com>
PR c++/91110
* decl2.c (cp_omp_mappable_type_1): Don't emit any note for
error_mark_node type.
2019-07-05 Jakub Jelinek <jakub@redhat.com>
PR c++/67184

View file

@ -1416,7 +1416,7 @@ cp_omp_mappable_type_1 (tree type, bool notes)
/* Mappable type has to be complete. */
if (type == error_mark_node || !COMPLETE_TYPE_P (type))
{
if (notes)
if (notes && type != error_mark_node)
{
tree decl = TYPE_MAIN_DECL (type);
inform ((decl ? DECL_SOURCE_LOCATION (decl) : input_location),

View file

@ -1,3 +1,8 @@
2019-07-08 Jakub Jelinek <jakub@redhat.com>
PR c++/91110
* g++.dg/gomp/pr91110.C: New test.
2019-07-08 Segher Boessenkool <segher@kernel.crashing.org>
PR rtl-optimization/88233

View file

@ -0,0 +1,11 @@
// PR c++/91110
// { dg-do compile }
void
foo ()
{
X b[2]; // { dg-error "'X' was not declared in this scope" }
b[0] = 1; // { dg-error "'b' was not declared in this scope" }
#pragma omp target map(to: b) // { dg-error "'b' does not have a mappable type in 'map' clause" }
;
}