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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [ext/] [vla1.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 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-prune-output "no member" }
26
}

powered by: WebSVN 2.1.0

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