From 8811b3904c4f3648c958e24a51a05e6b1c311e5a Mon Sep 17 00:00:00 2001 From: Kaelyn Uhrain Date: Wed, 11 Jan 2012 21:17:51 +0000 Subject: Fix the caching in CorrectTypo so that other non-keyword identifiers are still added if the cached correction fails validation. Also fix a copy-and-paste error in a comment from my previous commit. Finally, add an example of the benefit the typo correction callback adds to TryNamespaceTypoCorrection--which happens to also tickle the above caching problem, as the only way a non-namespace Decl would be added to the possible corrections is if it was cached as the correction for a previous instance of the same typo where the typo was corrected to a non-namespace via a different code path. llvm-svn: 147968 --- clang/lib/Sema/SemaDeclCXX.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/Sema/SemaDeclCXX.cpp') diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index f21d7664e5e..9fcac224a23 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -1747,7 +1747,8 @@ Sema::ActOnMemInitializer(Decl *ConstructorD, namespace { -// Callback to only accept typo corrections that are namespaces. +// Callback to only accept typo corrections that can be a valid C++ member +// intializer: either a non-static field member or a base class. class MemInitializerValidatorCCC : public CorrectionCandidateCallback { public: explicit MemInitializerValidatorCCC(CXXRecordDecl *ClassDecl) -- cgit v1.2.3