PR objc++/68932 - FAIL: obj-c++.dg/property/at-property-23.mm -fgnu-runtime
authorMartin Sebor <msebor@redhat.com>
Wed, 16 Dec 2015 23:56:27 +0000 (23:56 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Wed, 16 Dec 2015 23:56:27 +0000 (16:56 -0700)
PR objc++/68932  - FAIL: obj-c++.dg/property/at-property-23.mm -fgnu-runtime
                   (internal compiler error)

cp/
* decl.c (grokdeclarator): Avoid assuming ctype is non-null when
checking the validity of a flexible array member.

testsuite/
* obj-c++.dg/property/at-property-23.mm: Remove check for
an error message.

From-SVN: r231726

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/obj-c++.dg/property/at-property-23.mm

index 46b67125a5b893499a33a4ee7c7df370f821e42a..4d7a5f3ad40b9b3c6f3f4ddf12e83ef4cbc9f697 100644 (file)
@@ -1,3 +1,9 @@
+2015-12-16  Martin Sebor  <msebor@redhat.com>
+
+       PR objc++/68932
+       * decl.c (grokdeclarator): Avoid assuming ctype is non-null when
+       checking the validity of a flexible array member.
+
 2015-12-16  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * pt.c (comp_template_args): Remove.
index 77358c4c6856d290ea302fb0047237c3d13cfcdc..7d45d4dc1f518fd3642cbf7a8a739fd07600464d 100644 (file)
@@ -10933,8 +10933,9 @@ grokdeclarator (const cp_declarator *declarator,
        if (!staticp && TREE_CODE (type) == ARRAY_TYPE
            && TYPE_DOMAIN (type) == NULL_TREE)
          {
-           if (TREE_CODE (ctype) == UNION_TYPE
-               || TREE_CODE (ctype) == QUAL_UNION_TYPE)
+           if (ctype
+               && (TREE_CODE (ctype) == UNION_TYPE
+                   || TREE_CODE (ctype) == QUAL_UNION_TYPE))
              {
                error ("flexible array member in union");
                type = error_mark_node;
index 9ce80b1bc10e71d4073438e268375664cc902d1b..63d8b44381936a7551d9d19cbcfb4ff2d4e9c284 100644 (file)
@@ -1,3 +1,9 @@
+2015-12-16  Martin Sebor  <msebor@redhat.com>
+
+       PR objc++/68932
+       * obj-c++.dg/property/at-property-23.mm: Remove check for
+       an error message.
+
 2015-12-13  Jeff Law  <law@redhat.com>
 
        * gcc.dg/tree-ssa/pr68619-4.c: Change size of code bitfield.
index 73138f64c4a3cdaf4e555c831839b7e91571d2e7..035cc8b10fe9ce1f24abf3030e8867791f920d41 100644 (file)
@@ -14,5 +14,4 @@
 @property int a[8]; /* { dg-error "property can not be an array" } */
 @property int b:8;  /* { dg-error "expected" } */
 @property int c[];  /* { dg-error "property can not be an array" } */
-                    /* { dg-error "ISO C.. forbids zero-size array" "" { target *-*-* } 16 } */
 @end