OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [ext/] [vla1.C] - Blame information for rev 308

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// { dg-do compile }
2
 
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.
7
 
8
class A { A (int); };
9
 
10
A::A (int i)
11
{
12
  int ar[1][i];    // { dg-error "variable length array" }
13
 
14
  ar[0][0] = 0;
15
}
16
 
17
class B { B (int); };
18
 
19
B::B (int i)
20
{
21
  struct S {
22
    int ar[1][i];  // { dg-error "array" }
23
  } s;
24
 
25
  s.ar[0][0] = 0;  // { dg-error "no member" }
26
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.