'gcc-3_2-branch'.
From-SVN: r58541
--- /dev/null
+// { dg-do compile }
+
+// Crash tests from PR middle-end/6994. See also gcc.dg/vla-2.c.
+// A::A is acceptable extended C++ (VLA types brought over from C99);
+// B::B is not, but is closely related to acceptable extended C, though
+// not to acceptable C99.
+
+class A { A (int); };
+
+A::A (int i)
+{
+ int ar[1][i]; // { dg-error "variable-size array" }
+
+ ar[0][0] = 0;
+}
+
+class B { B (int); };
+
+B::B (int i)
+{
+ struct S {
+ int ar[1][i]; // { dg-error "variable-size|variably modified" }
+ } s;
+
+ s.ar[0][0] = 0; // { dg-error "no member" }
+}
--- /dev/null
+// { dg-do compile }
+// crash test - PR 7266
+
+template <class A>
+struct B {
+ typedef A::C::D E; // { dg-error "no type|parse error" }
+};
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* These are crash tests related to PR middle-end/6994; see also
+ g++.dg/ext/vla1.C. Note that at present A and C cannot be inlined. */
+
+static inline void A (int i)
+{
+ struct S { int ar[1][i]; } s;
+
+ s.ar[0][0] = 0;
+}
+
+void B(void)
+{
+ A(23);
+}
+
+static inline void C (int i)
+{
+ union U { int ar[1][i]; } u;
+
+ u.ar[0][0] = 0;
+}
+
+void D(void)
+{
+ C(23);
+}