]> granicus.if.org Git - clang/commitdiff
The checking for the delimiters of expected error/warning messages was
authorBill Wendling <isanbard@gmail.com>
Mon, 26 Nov 2007 08:26:20 +0000 (08:26 +0000)
committerBill Wendling <isanbard@gmail.com>
Mon, 26 Nov 2007 08:26:20 +0000 (08:26 +0000)
looking only for { and } instead of {{ and }}. Changed it to check for
this explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44326 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/DiagChecker.cpp
test/Analysis/uninit-vals.c
test/Lexer/cxx0x_keyword.cpp
test/Sema/cfstring.c
test/Sema/class-def-test-1.m

index 8daaa6cce2dc1228bdb9f35c2170c9a2512a1087..81d3e1b8f5af924cb2961bd5c99b3b8a0a1d9932 100644 (file)
@@ -57,7 +57,7 @@ static void FindDiagnostics(const std::string &Comment,
     ColNo = Comment.find(ExpectedStr, ColNo);
     if (ColNo == std::string::npos) break;
 
-    size_type OpenDiag = Comment.find_first_of("{{", ColNo);
+    size_type OpenDiag = Comment.find("{{", ColNo);
 
     if (OpenDiag == std::string::npos) {
       fprintf(stderr,
@@ -67,7 +67,7 @@ static void FindDiagnostics(const std::string &Comment,
     }
 
     OpenDiag += 2;
-    size_type CloseDiag = Comment.find_first_of("}}", OpenDiag);
+    size_type CloseDiag = Comment.find("}}", OpenDiag);
 
     if (CloseDiag == std::string::npos) {
       fprintf(stderr,
index ccd048f2882d29bc231cd3d0b50b39101090bd1b..041c946fb0c52532a183b8b7735d9f2e7abb9058 100644 (file)
@@ -2,19 +2,19 @@
 
 int f1() {
   int x;
-  return x; // expected-warning{use of uninitialized variable}
+  return x; // expected-warning {{use of uninitialized variable}}
 }
 
 int f2(int x) {
   int y;
-  int z = x + y; // expected-warning {use of uninitialized variable}
+  int z = x + y; // expected-warning {{use of uninitialized variable}}
   return z;
 }
 
 
 int f3(int x) {
   int y;
-  return x ? 1 : y; // expected-warning {use of uninitialized variable}
+  return x ? 1 : y; // expected-warning {{use of uninitialized variable}}
 }
 
 int f4(int x) {
@@ -31,7 +31,7 @@ int f5() {
 void f6(int i) {
   int x;
   for (i = 0 ; i < 10; i++)
-    printf("%d",x++); // expected-warning {use of uninitialized variable}
+    printf("%d",x++); // expected-warning {{use of uninitialized variable}}
 }
 
 void f7(int i) {
@@ -39,6 +39,6 @@ void f7(int i) {
   int y;
   for (i = 0; i < 10; i++ ) {
     printf("%d",x++); // no-warning
-    x += y; // expected-warning {use of uninitialized variable}
+    x += y; // expected-warning {{use of uninitialized variable}}
   }
-}
\ No newline at end of file
+}
index dd889a1f001a37475f370fb6ee759dfeca12769b..d55649cecc7d466fe14e3070df6c962f2da39ea3 100644 (file)
@@ -1,2 +1,2 @@
 // RUN: clang -fsyntax-only -verify -std=c++0x %s 2>&1
-int static_assert; /* expected-error {{expected identifier or '('}}} */
+int static_assert; /* expected-error {{expected identifier or '('}} */
index d4a8552212cf325c5867191e89f70b6e6376d7c1..5c815d0ae8c9c671bb99808f3c83a94e485d496f 100644 (file)
@@ -2,9 +2,9 @@
 
 // RUN: clang %s -fsyntax-only -verify
 void f() {
-  CFSTR("\242"); // expected-warning { CFString literal contains non-ASCII character }
-  CFSTR("\0"); // expected-warning { CFString literal contains NUL character }
-  CFSTR(242); // expected-error { error: CFString literal is not a string constant } \
-  expected-warning { incompatible types }
-  CFSTR("foo", "bar"); // expected-error { error: too many arguments to function }
+  CFSTR("\242"); // expected-warning {{ CFString literal contains non-ASCII character }}
+  CFSTR("\0"); // expected-warning {{ CFString literal contains NUL character }}
+  CFSTR(242); // expected-error {{ CFString literal is not a string constant }} \
+    expected-warning {{incompatible types}}
+  CFSTR("foo", "bar"); // expected-error {{ error: too many arguments to function }}
 }
index 91de54fbed71f8f342819ceba4b6d1eaa8deaff8..94a01cc255453ed9b714f948d09fe102036a88b2 100644 (file)
@@ -12,7 +12,7 @@ typedef int INTF; //  expected-error {{previous definition is here}}
 
 @interface INTF1 : OBJECT @end
 
-@interface INTF1 : OBJECT @end // expected-error {{duplicate interface declaration for class 'INTF1'}
+@interface INTF1 : OBJECT @end // expected-error {{duplicate interface declaration for class 'INTF1'}}
 
 typedef int OBJECT; // expected-error {{previous definition is here}}  \
                       expected-error {{redefinition of 'OBJECT' as different kind of symbol}}