From 0afa7f66cd98b93990f52fe93938a44e29cba310 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 14 Oct 2010 20:34:08 +0000 Subject: Tweak the typo-correction implementation to determine corrections solely based on the names it sees, rather than actual declarations it gets. In essence, we determine the set of names that are "close enough" to the typo'd name. Then, we perform name lookup for each of those names, filtering out those that aren't actually visible, and typo-correct from the remaining results. Overall, there isn't much of a change in the behavior of typo correction here. The only test-suite change comes from the fact that we make good on our promise to require that the user type 3 characters for each 1 character corrected. The real intent behind this change is to set the stage for an optimization to typo correction (so that we don't need to deserialize all declarations in a translation unit) and future work in finding missing qualification ("'vector' isn't in scope; did you mean 'std::vector'?). Plus, the code is cleaner this way. llvm-svn: 116511 --- clang/test/Sema/switch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/test') diff --git a/clang/test/Sema/switch.c b/clang/test/Sema/switch.c index bb4822916cc..96a6eb6e963 100644 --- a/clang/test/Sema/switch.c +++ b/clang/test/Sema/switch.c @@ -77,7 +77,7 @@ void test6() { } // PR5606 -int f0(int var) { // expected-note{{'var' declared here}} +int f0(int var) { switch (va) { // expected-error{{use of undeclared identifier 'va'}} case 1: break; -- cgit v1.2.3