summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Sema/SemaLookup.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp
index fc07e7273fc..52f4c84cb8c 100644
--- a/clang/lib/Sema/SemaLookup.cpp
+++ b/clang/lib/Sema/SemaLookup.cpp
@@ -3982,14 +3982,13 @@ TypoCorrection Sema::CorrectTypo(const DeclarationNameInfo &TypoName,
TypoCorrectionConsumer Consumer(*this, Typo);
+ // If we're handling a missing symbol error, using modules, and the
+ // special search all modules option is used, look for a missing import.
if ((Mode == CTK_ErrorRecovery) && getLangOpts().Modules &&
getLangOpts().ModulesSearchAll) {
- if (getModuleLoader().lookupMissingImports(Typo->getName(),
- TypoName.getLocStart())) {
- TypoCorrection TC(TypoName.getName(), (NestedNameSpecifier *)0, 0);
- TC.setCorrectionRange(SS, TypoName);
- TC.setRequiresImport(true);
- }
+ // The following has the side effect of loading the missing module.
+ getModuleLoader().lookupMissingImports(Typo->getName(),
+ TypoName.getLocStart());
}
NamespaceSpecifierSet Namespaces(Context, CurContext, SS);
OpenPOWER on IntegriCloud