summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
authorFrancois Pichet <pichet2000@gmail.com>2011-12-03 15:55:29 +0000
committerFrancois Pichet <pichet2000@gmail.com>2011-12-03 15:55:29 +0000
commit9c39113fdb155b3dda7c461f533466a6b6997fe4 (patch)
tree7274e06dc51cdb0789ded28143b0e28d9c5c37d8 /clang/lib/Sema/SemaLookup.cpp
parentbbf3c60786479cf5d6bf565e8447dae74868438d (diff)
downloadbcm5719-llvm-9c39113fdb155b3dda7c461f533466a6b6997fe4.tar.gz
bcm5719-llvm-9c39113fdb155b3dda7c461f533466a6b6997fe4.zip
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. llvm-svn: 145772
Diffstat (limited to 'clang/lib/Sema/SemaLookup.cpp')
-rw-r--r--clang/lib/Sema/SemaLookup.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp
index c232515ef36..9f1e9a5516b 100644
--- a/clang/lib/Sema/SemaLookup.cpp
+++ b/clang/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)
OpenPOWER on IntegriCloud