diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-10-14 20:34:08 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-10-14 20:34:08 +0000 |
commit | 0afa7f66cd98b93990f52fe93938a44e29cba310 (patch) | |
tree | a277a0fc2dbb0bb74eb198ff7ab0a29a3c380f2e /clang/test | |
parent | a3037c3abd6f7aa2f4187b169b22d96e96a73250 (diff) | |
download | bcm5719-llvm-0afa7f66cd98b93990f52fe93938a44e29cba310.tar.gz bcm5719-llvm-0afa7f66cd98b93990f52fe93938a44e29cba310.zip |
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
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/Sema/switch.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |