From f5f20bdf918cedb47fdd33f5b634f4908cdd3f15 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 26 Nov 2007 08:26:20 +0000 Subject: [PATCH] The checking for the delimiters of expected error/warning messages was 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 | 4 ++-- test/Analysis/uninit-vals.c | 12 ++++++------ test/Lexer/cxx0x_keyword.cpp | 2 +- test/Sema/cfstring.c | 10 +++++----- test/Sema/class-def-test-1.m | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Driver/DiagChecker.cpp b/Driver/DiagChecker.cpp index 8daaa6cce2..81d3e1b8f5 100644 --- a/Driver/DiagChecker.cpp +++ b/Driver/DiagChecker.cpp @@ -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, diff --git a/test/Analysis/uninit-vals.c b/test/Analysis/uninit-vals.c index ccd048f288..041c946fb0 100644 --- a/test/Analysis/uninit-vals.c +++ b/test/Analysis/uninit-vals.c @@ -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 +} diff --git a/test/Lexer/cxx0x_keyword.cpp b/test/Lexer/cxx0x_keyword.cpp index dd889a1f00..d55649cecc 100644 --- a/test/Lexer/cxx0x_keyword.cpp +++ b/test/Lexer/cxx0x_keyword.cpp @@ -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 '('}} */ diff --git a/test/Sema/cfstring.c b/test/Sema/cfstring.c index d4a8552212..5c815d0ae8 100644 --- a/test/Sema/cfstring.c +++ b/test/Sema/cfstring.c @@ -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 }} } diff --git a/test/Sema/class-def-test-1.m b/test/Sema/class-def-test-1.m index 91de54fbed..94a01cc255 100644 --- a/test/Sema/class-def-test-1.m +++ b/test/Sema/class-def-test-1.m @@ -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}} -- 2.40.0