File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -7626,6 +7626,11 @@ bool importer::requiresCPlusPlus(const clang::Module *module) {
76267626 // The libc++ modulemap doesn't currently declare the requirement.
76277627 if (module ->getTopLevelModuleName () == " std" )
76287628 return true ;
7629+ // In recent libc++ versions the module is split into multiple top-level
7630+ // modules (std_vector, std_utility, etc).
7631+ if (module ->getTopLevelModule ()->IsSystem &&
7632+ module ->getTopLevelModuleName ().starts_with (" std_" ))
7633+ return true ;
76297634
76307635 // Modulemaps often declare the requirement for the top-level module only.
76317636 if (auto parent = module ->Parent ) {
Original file line number Diff line number Diff line change @@ -3389,7 +3389,10 @@ namespace {
33893389 ->getTopLevelModule ()
33903390 ->getFullModuleName () == n;
33913391 };
3392- if (topLevelModuleEq (decl, " std" )) {
3392+ if (topLevelModuleEq (decl, " std" ) ||
3393+ (decl->getOwningModule () && decl->getOwningModule ()->IsSystem &&
3394+ StringRef (decl->getOwningModule ()->getTopLevelModule ()->Name )
3395+ .starts_with (" std_" ))) {
33933396 if (isAlternativeCStdlibFunctionFromTextualHeader (decl)) {
33943397 return nullptr ;
33953398 }
You can’t perform that action at this time.
0 commit comments