Skip to content

Commit 2cd86d9

Browse files
egorzhdanetcwilde
authored andcommitted
[cxx-interop] Do not import std::chrono::time_zone_link
This type is non-copyable, but its implementation in libstdc++13 does not explicitly declare a deleted copy constructor. After rebranch, we should start using API Notes to annotate the type as a non-copyable type in Swift. For now, this change disables import of this type. See swiftlang#73086 rdar://134432426 (cherry picked from commit 386c8eb)
1 parent 4b771a6 commit 2cd86d9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2640,6 +2640,15 @@ namespace {
26402640
return nullptr;
26412641
}
26422642

2643+
// Bail if this is `std::chrono::tzdb`. This type causes issues in copy
2644+
// constructor instantiation.
2645+
// FIXME: https://github.com/apple/swift/issues/73037
2646+
if (decl->getDeclContext()->isNamespace() &&
2647+
decl->getDeclContext()->getParent()->isStdNamespace() &&
2648+
decl->getIdentifier() &&
2649+
(decl->getName() == "tzdb" || decl->getName() == "time_zone_link"))
2650+
return nullptr;
2651+
26432652
auto &clangSema = Impl.getClangSema();
26442653
// Make Clang define any implicit constructors it may need (copy,
26452654
// default). Make sure we only do this if the class has been fully defined

0 commit comments

Comments
 (0)