diff options
author | Francois Pichet <pichet2000@gmail.com> | 2011-12-03 15:55:29 +0000 |
---|---|---|
committer | Francois Pichet <pichet2000@gmail.com> | 2011-12-03 15:55:29 +0000 |
commit | 4d604d6f1d413864e7dad8e368ba9a69a3f478c7 (patch) | |
tree | af0846e4441ca39d990418f6b667bcc530206552 /lib/Sema/SemaLookup.cpp | |
parent | 1cdb70b20793cb88c89282c78f6afe55c7c578c3 (diff) |
In Microsoft mode, don't perform typo correction in a template member function dependent context because it interferes with the "lookup into dependent bases of class templates" feature.
Basically typo correction will try to offer a correction instead of looking into type dependent base classes.
I found this problem while parsing Microsoft ATL code with clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145772 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLookup.cpp')
-rw-r--r-- | lib/Sema/SemaLookup.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index c232515ef3..9f1e9a5516 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -3556,6 +3556,13 @@ TypoCorrection Sema::CorrectTypo(const DeclarationNameInfo &TypoName, if (Diags.hasFatalErrorOccurred() || !getLangOptions().SpellChecking) return TypoCorrection(); + // In Microsoft mode, don't perform typo correction in a template member + // function dependent context because it interferes with the "lookup into + // dependent bases of class templates" feature. + if (getLangOptions().MicrosoftMode && CurContext->isDependentContext() && + isa<CXXMethodDecl>(CurContext)) + return TypoCorrection(); + // We only attempt to correct typos for identifiers. IdentifierInfo *Typo = TypoName.getName().getAsIdentifierInfo(); if (!Typo) |