Skip to content

Commit 9121192

Browse files
authored
Merge pull request #78676 from porglezomp-misc/workaround-simd-quatf
2 parents d18510b + c7021ae commit 9121192

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,14 @@ namespace {
11661166
decl->getOwningModule() &&
11671167
decl->getOwningModule()->getTopLevelModuleName() == "os")
11681168
return nullptr;
1169+
// Workaround for simd module declaring `namespace simd` on Darwin,
1170+
// causing name lookup issues. That namespace declares C++ overlays of
1171+
// types that are already refined for Swift, so let's not import the
1172+
// namespace (rdar://143007477).
1173+
if (decl->getIdentifier() && decl->getName() == "simd" &&
1174+
decl->getOwningModule() &&
1175+
decl->getOwningModule()->getTopLevelModuleName() == "simd")
1176+
return nullptr;
11691177
// If this is a top-level namespace, don't put it in the module we're
11701178
// importing, put it in the "__ObjC" module that is implicitly imported.
11711179
if (!decl->getParent()->isNamespace())
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// RUN: %target-swift-frontend -typecheck -verify -I %S/Inputs -cxx-interoperability-mode=default %s
2+
3+
// REQUIRES: objc_interop
4+
// REQUIRES: VENDOR=apple
5+
6+
import simd
7+
8+
var _: simd.simd_quatf! = nil

0 commit comments

Comments
 (0)