diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-04-18 18:42:55 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-04-18 18:42:55 +0000 |
| commit | 07f62f1881b22fc9d3151cf277e33755c7baa4cd (patch) | |
| tree | 974c4272c4cc51edef2913726420f726754101f9 /clang/test | |
| parent | e227091199da23f5d6e22897aae6338e82943e87 (diff) | |
| download | bcm5719-llvm-07f62f1881b22fc9d3151cf277e33755c7baa4cd.tar.gz bcm5719-llvm-07f62f1881b22fc9d3151cf277e33755c7baa4cd.zip | |
improve wording of scope violation error messages.
llvm-svn: 69456
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Sema/scope-check.c | 21 | ||||
| -rw-r--r-- | clang/test/SemaObjC/scope-check.m | 2 |
2 files changed, 6 insertions, 17 deletions
diff --git a/clang/test/Sema/scope-check.c b/clang/test/Sema/scope-check.c index 21908fc285d..4c3480ea275 100644 --- a/clang/test/Sema/scope-check.c +++ b/clang/test/Sema/scope-check.c @@ -1,27 +1,16 @@ // RUN: clang-cc -fsyntax-only -verify %s -/* -"/tmp/bug.c", line 2: error: transfer of control bypasses initialization of: - variable length array "a" (declared at line 3) - variable length array "b" (declared at line 3) - goto L; - ^ -"/tmp/bug.c", line 3: warning: variable "b" was declared but never referenced - int a[x], b[x]; - ^ -*/ - int test1(int x) { goto L; // expected-error{{illegal goto into protected scope}} - int a[x]; // expected-note {{scope created by variable length array}} - int b[x]; // expected-note {{scope created by variable length array}} + int a[x]; // expected-note {{jump bypasses initialization of variable length array}} + int b[x]; // expected-note {{jump bypasses initialization of variable length array}} L: return sizeof a; } int test2(int x) { goto L; // expected-error{{illegal goto into protected scope}} - typedef int a[x]; // expected-note {{scope created by VLA typedef}} + typedef int a[x]; // expected-note {{jump bypasses initialization of VLA typedef}} L: return sizeof(a); } @@ -30,14 +19,14 @@ void test3clean(int*); int test3() { goto L; // expected-error{{illegal goto into protected scope}} -int a __attribute((cleanup(test3clean))); // expected-note {{scope created by declaration with __attribute__((cleanup))}} +int a __attribute((cleanup(test3clean))); // expected-note {{jump bypasses initialization of declaration with __attribute__((cleanup))}} L: return a; } int test4(int x) { goto L; // expected-error{{illegal goto into protected scope}} -int a[x]; // expected-note {{scope created by variable length array}} +int a[x]; // expected-note {{jump bypasses initialization of variable length array}} test4(x); L: return sizeof a; diff --git a/clang/test/SemaObjC/scope-check.m b/clang/test/SemaObjC/scope-check.m index fbec2543829..7a28ebbed3e 100644 --- a/clang/test/SemaObjC/scope-check.m +++ b/clang/test/SemaObjC/scope-check.m @@ -6,7 +6,7 @@ void test1() { goto L; // expected-error{{illegal goto into protected scope}} goto L2; // expected-error{{illegal goto into protected scope}} goto L3; // expected-error{{illegal goto into protected scope}} - @try { // expected-note 3 {{scope created by @try block}} + @try { // expected-note 3 {{jump bypasses initialization of @try block}} L: ; } @catch (A *x) { L2: ; |

