Skip to content

Commit c90cb4b

Browse files
committed
[cxx-interop] Do not try to import std::tzdb
In libstdc++13 on Ubuntu 23.10 the type `std::tzdb` is non-copyable but does not explicitly delete its copy constructor. It instead triggers template instantiation errors when trying to use the copy constructor. This is problematic for Swift, since we try to instantiate copy constructors for most C++ types we import. This disables the import of `std::tzdb` to unblock nightly toolchains for Ubuntu 23.10 until we come up with a better solution. rdar://126486849 / swiftlang#73037
1 parent cfe2728 commit c90cb4b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2650,6 +2650,13 @@ namespace {
26502650
return nullptr;
26512651
}
26522652

2653+
// Bail if this is `std::tzdb`. This type causes issues in copy
2654+
// constructor instantiation.
2655+
// FIXME: https://github.com/apple/swift/issues/73037
2656+
if (decl->isInStdNamespace() && decl->getIdentifier() &&
2657+
decl->getName() == "tzdb")
2658+
return nullptr;
2659+
26532660
auto &clangSema = Impl.getClangSema();
26542661
// Make Clang define any implicit constructors it may need (copy,
26552662
// default). Make sure we only do this if the class has been fully defined

0 commit comments

Comments
 (0)