summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaInit.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-14 20:04:41 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-14 20:04:41 +0000
commit280e1ee0ae44f161971539ad6ab965169b932ae9 (patch)
tree31621cbbc1e63f6bf5865974a5e6481e71c610eb /clang/lib/Sema/SemaInit.cpp
parent7deb447781bee7639ffb12a31c8e4f74a2ba9db8 (diff)
downloadbcm5719-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/SemaInit.cpp')
-rw-r--r--clang/lib/Sema/SemaInit.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp
index 52a5cb13724..dae3d3ae7e6 100644
--- a/clang/lib/Sema/SemaInit.cpp
+++ b/clang/lib/Sema/SemaInit.cpp
@@ -1354,7 +1354,8 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity,
// was a typo for another field name.
LookupResult R(SemaRef, FieldName, D->getFieldLoc(),
Sema::LookupMemberName);
- if (SemaRef.CorrectTypo(R, /*Scope=*/0, /*SS=*/0, RT->getDecl()) &&
+ if (SemaRef.CorrectTypo(R, /*Scope=*/0, /*SS=*/0, RT->getDecl(), false,
+ Sema::CTC_NoKeywords) &&
(ReplacementField = R.getAsSingle<FieldDecl>()) &&
ReplacementField->getDeclContext()->getLookupContext()
->Equals(RT->getDecl())) {
OpenPOWER on IntegriCloud