2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / ext / vla1.C
blobbac5aaca1a50cb44fa1eeabd42d7ea33bb9396c8
1 // { dg-do compile }
3 // Crash tests from PR middle-end/6994.  See also gcc.dg/vla-2.c.
4 // A::A is acceptable extended C++ (VLA types brought over from C99);
5 // B::B is not, but is closely related to acceptable extended C, though
6 // not to acceptable C99.
8 class A { A (int); };
10 A::A (int i)
12   int ar[1][i];    // { dg-error "variable-size array" }
14   ar[0][0] = 0;
17 class B { B (int); };
19 B::B (int i)
21   struct S {
22     int ar[1][i];  // { dg-error "variable-size|variably modified" }
23   } s;
25   s.ar[0][0] = 0;  // { dg-error "no member" }