]> granicus.if.org Git - clang/commitdiff
improve wording of scope violation error messages.
authorChris Lattner <sabre@nondot.org>
Sat, 18 Apr 2009 18:42:55 +0000 (18:42 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 18 Apr 2009 18:42:55 +0000 (18:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69456 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticSemaKinds.td
test/Sema/scope-check.c
test/SemaObjC/scope-check.m

index ef7117afc7c00e226f17bdaca09df978b1594a86..bf2ff2dd4551e6c8eff44c38a94c33d09d114ac3 100644 (file)
@@ -833,13 +833,13 @@ def err_undeclared_label_use : Error<"use of undeclared label '%0'">;
 
 def err_goto_into_protected_scope : Error<"illegal goto into protected scope">;
 def note_protected_by_vla_typedef : Note<
-  "scope created by VLA typedef">;
+  "jump bypasses initialization of VLA typedef">;
 def note_protected_by_vla : Note<
-  "scope created by variable length array">;
+  "jump bypasses initialization of variable length array">;
 def note_protected_by_cleanup : Note<
-  "scope created by declaration with __attribute__((cleanup))">;
+  "jump bypasses initialization of declaration with __attribute__((cleanup))">;
 def note_protected_by_objc_try : Note<
-  "scope created by @try block">;
+  "jump bypasses initialization of @try block">;
 
 def err_func_returning_array_function : Error<
   "function cannot return array or function type %0">;
index 21908fc285d7ddb2c3fe1e835c90ffd2e8a14ad6..4c3480ea27537e6efc5c642e52ecba1fc0764c1d 100644 (file)
@@ -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;
index fbec2543829224ac7244ac12e5a40a77c8f678fe..7a28ebbed3e7d9a65bc30b3c1eb93a78dba665ed 100644 (file)
@@ -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: ;