[cfe-commits] r69456 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td test/Sema/scope-check.c test/SemaObjC/scope-check.m

Chris Lattner sabre at nondot.org
Sat Apr 18 11:42:56 PDT 2009


Author: lattner
Date: Sat Apr 18 13:42:55 2009
New Revision: 69456

URL: http://llvm.org/viewvc/llvm-project?rev=69456&view=rev
Log:
improve wording of scope violation error messages.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/trunk/test/Sema/scope-check.c
    cfe/trunk/test/SemaObjC/scope-check.m

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=69456&r1=69455&r2=69456&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Sat Apr 18 13:42:55 2009
@@ -833,13 +833,13 @@
 
 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">;

Modified: cfe/trunk/test/Sema/scope-check.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/scope-check.c?rev=69456&r1=69455&r2=69456&view=diff

==============================================================================
--- cfe/trunk/test/Sema/scope-check.c (original)
+++ cfe/trunk/test/Sema/scope-check.c Sat Apr 18 13:42:55 2009
@@ -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 @@
 
 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;

Modified: cfe/trunk/test/SemaObjC/scope-check.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/scope-check.m?rev=69456&r1=69455&r2=69456&view=diff

==============================================================================
--- cfe/trunk/test/SemaObjC/scope-check.m (original)
+++ cfe/trunk/test/SemaObjC/scope-check.m Sat Apr 18 13:42:55 2009
@@ -6,7 +6,7 @@
   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: ;





More information about the cfe-commits mailing list