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);