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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [ext/] [vla1.C] - Rev 149

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

// { 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 "array" }
  } s;

  s.ar[0][0] = 0;  // { dg-error "no member" }
}

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

powered by: WebSVN 2.1.0

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