Eli Friedman wrote:-

> +// RUN: clang -fsyntax-only -verify %s
> +
> +int test1(int x) {
> +  goto L; // expected-error{{illegal jump}}
> +  int a[x];
> +  L:
> +  return sizeof a;
> +}

It would be nice to mention the thing(s) forming the scoping
violation; e.g. for my fe:

$ ./cfe /tmp/bug.c
"/tmp/bug.c", line 2: error: branching bypasses declaration of
        variable-length array "a" at line 3
  goto L; // expected-error{{illegal jump}}
  ^
"/tmp/bug.c", line 3: warning: variable "a" declared but not used
  int a[x];
      ^

1 error found compiling "/tmp/bug.c".

Neil.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to