Don't correct typos in Sema::BuildCXXNestedNameSpecifier with -fms-extensions
authorKaelyn Uhrain <rikka@google.com>
Thu, 19 Sep 2013 22:38:48 +0000 (22:38 +0000)
committerKaelyn Uhrain <rikka@google.com>
Thu, 19 Sep 2013 22:38:48 +0000 (22:38 +0000)
When -fms-extensions is enabled, the typo correction was being called here on
non-error paths (as in test/SemaTemplate/lookup-dependent-bases.cpp) and correct
compilation depended on Sema::CorrectTypo not finding a viable candidate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191046 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaCXXScopeSpec.cpp

index 327d55f0b3fef3c525c810b34158599d40044577..f79ad2cc8c7e42a15987db821611ce3acbfca0b5 100644 (file)
@@ -484,7 +484,7 @@ bool Sema::BuildCXXNestedNameSpecifier(Scope *S,
   
   // FIXME: Deal with ambiguities cleanly.
 
-  if (Found.empty() && !ErrorRecoveryLookup) {
+  if (Found.empty() && !ErrorRecoveryLookup && !getLangOpts().MicrosoftExt) {
     // We haven't found anything, and we're not recovering from a
     // different kind of error, so look for typos.
     DeclarationName Name = Found.getLookupName();