diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-04-27 03:47:06 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-04-27 03:47:06 +0000 |
commit | 27766d2501259c7b12b1056e0c491a927b304e10 (patch) | |
tree | 36791008569ca6271234dd8762483eff6f5a6944 /test/FixIt | |
parent | 17ffd14040069eb5631347c6eafcfc906570b7cf (diff) | |
download | clang-27766d2501259c7b12b1056e0c491a927b304e10.tar.gz |
Improve diagnostics for typo correction via Sema::ClassifyName(), by
looking at the context and the correction and using a custom
diagnostic. Also, enable some Fix-It tests that were somewhat lamely
disabled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130283 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/FixIt')
-rw-r--r-- | test/FixIt/typo.c | 4 | ||||
-rw-r--r-- | test/FixIt/typo.cpp | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/test/FixIt/typo.c b/test/FixIt/typo.c index 8a277c75f0..88d9dc62a1 100644 --- a/test/FixIt/typo.c +++ b/test/FixIt/typo.c @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s // RUN: cp %s %t -// RUN: %clang_cc1 -fsyntax-only -fixit -x c %t || true +// RUN: not %clang_cc1 -fsyntax-only -fixit -x c %t // RUN: %clang_cc1 -fsyntax-only -pedantic -Werror -x c %t // RUN: grep "Rectangle" %t struct Point { @@ -30,7 +30,7 @@ void test() { r1.top_left.x = 0; typedef struct Rectangle Rectangle; // expected-note{{'Rectangle' declared here}} - rectangle *r2 = &r1; // expected-error{{use of undeclared identifier 'rectangle'; did you mean 'Rectangle'?}} + rectangle *r2 = &r1; // expected-error{{ unknown type name 'rectangle'; did you mean 'Rectangle'?}} r2->top_left.y = 0; unsinged *ptr = 0; // expected-error{{use of undeclared identifier 'unsinged'; did you mean 'unsigned'?}} *ptr = 17; diff --git a/test/FixIt/typo.cpp b/test/FixIt/typo.cpp index d1e732fd1d..440db45518 100644 --- a/test/FixIt/typo.cpp +++ b/test/FixIt/typo.cpp @@ -1,7 +1,8 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s // RUN: cp %s %t -// RUN: %clang_cc1 -fsyntax-only -fixit -x c++ %t || true +// RUN: not %clang_cc1 -fsyntax-only -fixit -x c++ %t // RUN: %clang_cc1 -fsyntax-only -pedantic -Werror -x c++ %t +// RUN: grep test_string %t namespace std { template<typename T> class basic_string { // expected-note 2{{'basic_string' declared here}} |