PR c/63549
* c-typeck.c (build_array_ref): Bail if the index in an incomplete
type.
* gcc.dg/pr63549.c: New test.
From-SVN: r216413
+2014-10-17 Marek Polacek <polacek@redhat.com>
+
+ PR c/63549
+ * c-typeck.c (build_array_ref): Bail if the index in an incomplete
+ type.
+
2014-10-17 Marek Polacek <polacek@redhat.com>
* c-decl.c (grokdeclarator): Use OPT_Wimplicit_int unconditionally.
/* Apply default promotions *after* noticing character types. */
index = default_conversion (index);
+ if (index == error_mark_node)
+ return error_mark_node;
gcc_assert (TREE_CODE (TREE_TYPE (index)) == INTEGER_TYPE);
+2014-10-17 Marek Polacek <polacek@redhat.com>
+
+ PR c/63549
+ * gcc.dg/pr63549.c: New test.
+
2014-10-17 Marek Polacek <polacek@redhat.com>
* gcc.dg/Wimplicit-int-1.c: New test.
--- /dev/null
+/* PR c/63549 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+enum E e;
+int a[10];
+int i = a[e]; /* { dg-error "has an incomplete type" } */