Here are just a few more issues I was wondering about for VLAs:

static int i;
static int new_i() { i++; return i; }
static int bar(int a[new_i()][new_i()]);

void foo(int n) {
/* Presently an error, but, should it be (due to bar having a VM type and bar having other than no linkage)? */
  extern int bar(int a[new_i()][new_i()]);
  /* Same question. */
  extern void foo2(int i[n][n]);
}

void foo1(int n) {
  goto A;
  /* No error for this, but it is a VM type?  */
  void foo2(int i[n][n]);
  /* Same question. */
  int bar(int a[new_i()][new_i()]);
  /* I think this is Ok.  */
int (*(*foo3)(void))[n]; /* { dg-error "jump into scope of identifier with variably modified type" } */
A:
  ;
}

Reply via email to