mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Importer] Ensure that we can see macro-expanded declarations in C++ namespaces
Lookup into C++ namespaces uses a different path from C++ record declarations. Augment the C++ namespace lookup path to also account for the auxiliary declarations introduced by peer macro expansions.
This commit is contained in:
@@ -329,6 +329,11 @@ void swift::performImportResolutionForClangMacroBuffer(
|
||||
ImportResolver resolver(SF);
|
||||
resolver.addImplicitImport(clangModule);
|
||||
|
||||
// FIXME: This is a hack that we shouldn't need, but be sure that we can
|
||||
// see the Swift standard library.
|
||||
if (auto stdlib = SF.getASTContext().getStdlibModule())
|
||||
resolver.addImplicitImport(stdlib);
|
||||
|
||||
SF.setImports(resolver.getFinishedImports());
|
||||
SF.setImportedUnderlyingModule(resolver.getUnderlyingClangModule());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user