diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-04-14 20:04:41 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-04-14 20:04:41 +0000 |
commit | 280e1ee0ae44f161971539ad6ab965169b932ae9 (patch) | |
tree | 31621cbbc1e63f6bf5865974a5e6481e71c610eb /clang/lib/Sema/SemaTemplate.cpp | |
parent | 7deb447781bee7639ffb12a31c8e4f74a2ba9db8 (diff) | |
download | bcm5719-llvm-280e1ee0ae44f161971539ad6ab965169b932ae9.tar.gz bcm5719-llvm-280e1ee0ae44f161971539ad6ab965169b932ae9.zip |
Teach typo correction about various language keywords. We can't
generally recover from typos in keywords (since we would effectively
have to mangle the token stream). However, there are still benefits to
typo-correcting with keywords:
- We don't make stupid suggestions when the user typed something
that is similar to a keyword.
- We can suggest the keyword in a diagnostic (did you mean
"static_cast"?), even if we can't recover and therefore don't have
a fix-it.
llvm-svn: 101274
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 9816e76530b..28d6f0a40aa 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -250,7 +250,8 @@ void Sema::LookupTemplateName(LookupResult &Found, if (Found.empty() && !isDependent) { // If we did not find any names, attempt to correct any typos. DeclarationName Name = Found.getLookupName(); - if (CorrectTypo(Found, S, &SS, LookupCtx)) { + if (DeclarationName Corrected = CorrectTypo(Found, S, &SS, LookupCtx, + false, CTC_CXXCasts)) { FilterAcceptableTemplateNames(Context, Found); if (!Found.empty() && isa<TemplateDecl>(*Found.begin())) { if (LookupCtx) |