aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2018-03-02 17:54:23 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2018-03-02 17:54:23 +0000
commit8c8f2ab7081d2e14b637c57583072392c3aeac88 (patch)
tree1483aee8a3827ba1a12096ad301895230f0be44d /gcc/cp
parent0805d020d789e40557531df22565eae7809e7f17 (diff)
downloadgcc-8c8f2ab7081d2e14b637c57583072392c3aeac88.zip
gcc-8c8f2ab7081d2e14b637c57583072392c3aeac88.tar.gz
gcc-8c8f2ab7081d2e14b637c57583072392c3aeac88.tar.bz2
re PR c++/84663 (internal compiler error: tree check: expected array_type, have error_mark in cp_complete_array_type, at cp/decl.c:8334)
PR c++/84663 * decl.c (cp_complete_array_type): Check error_mark_node. * g++.dg/parse/array-size3.C: New test. From-SVN: r258148
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 79e0d8f..29287c8 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2018-03-02 Marek Polacek <polacek@redhat.com>
+
+ PR c++/84663
+ * decl.c (cp_complete_array_type): Check error_mark_node.
+
2018-03-02 Jakub Jelinek <jakub@redhat.com>
PR c++/84662
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 735ed5d..1866e8f 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -8323,7 +8323,7 @@ cp_complete_array_type (tree *ptype, tree initial_value, bool do_default)
bits. See also complete_type which does the same thing for arrays
of fixed size. */
type = *ptype;
- if (TYPE_DOMAIN (type))
+ if (type != error_mark_node && TYPE_DOMAIN (type))
{
elt_type = TREE_TYPE (type);
TYPE_NEEDS_CONSTRUCTING (type) = TYPE_NEEDS_CONSTRUCTING (elt_type);