aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
authorKaelyn Uhrain <rikka@google.com>2012-01-11 21:17:51 +0000
committerKaelyn Uhrain <rikka@google.com>2012-01-11 21:17:51 +0000
commitdc98cd0cdd2eee8290b624ef69c6d91ce626d85e (patch)
tree2679907562fcb161f3c22447425c1214b9719739 /lib/Sema/SemaDeclCXX.cpp
parent3efd348d3586b22bb0153f17181128a1b3c41140 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147968 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--lib/Sema/SemaDeclCXX.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index f21d7664e5..9fcac224a2 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/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)