aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-07-09 00:08:27 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2019-07-09 00:08:27 +0200
commit9c6e2f8274d1e6a621e410dc945488aa9ff6f779 (patch)
treea41765b1a10d287173de4960f7694a9b0dcf5a05 /gcc
parent079e0f619684ff63b32e0fa02f460f57e271e3b4 (diff)
downloadgcc-9c6e2f8274d1e6a621e410dc945488aa9ff6f779.zip
gcc-9c6e2f8274d1e6a621e410dc945488aa9ff6f779.tar.gz
gcc-9c6e2f8274d1e6a621e410dc945488aa9ff6f779.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl2.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/gomp/pr91110.C11
4 files changed, 23 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 1967c9b..0fcbfe5 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index b415716..3aba194 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -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),
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a78c745..3e24415 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
diff --git a/gcc/testsuite/g++.dg/gomp/pr91110.C b/gcc/testsuite/g++.dg/gomp/pr91110.C
new file mode 100644
index 0000000..332c99a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/pr91110.C
@@ -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" }
+ ;
+}