Skip to content

Commit 05b6175

Browse files
committed
[cxx-interop] Do not import std::chrono::time_zone
This type is non-copyable and non-moveable despite having a defaulted move constructor. It cannot currently be expressed in Swift. Let's not try to import it into Swift. rdar://138123064 / resolves #76809
1 parent e86773a commit 05b6175

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2753,7 +2753,8 @@ namespace {
27532753
if (decl->getDeclContext()->isNamespace() &&
27542754
decl->getDeclContext()->getParent()->isStdNamespace() &&
27552755
decl->getIdentifier() &&
2756-
(decl->getName() == "tzdb" || decl->getName() == "time_zone_link"))
2756+
(decl->getName() == "tzdb" || decl->getName() == "time_zone_link" ||
2757+
decl->getName() == "time_zone"))
27572758
return nullptr;
27582759

27592760
auto &clangSema = Impl.getClangSema();

test/Interop/Cxx/stdlib/use-std-chrono.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// RUN: %target-run-simple-swift(-I %S/Inputs -cxx-interoperability-mode=upcoming-swift -Xcc -std=c++14)
55
// RUN: %target-run-simple-swift(-I %S/Inputs -cxx-interoperability-mode=upcoming-swift -Xcc -std=c++17)
66
// RUN: %target-run-simple-swift(-I %S/Inputs -cxx-interoperability-mode=upcoming-swift -Xcc -std=c++20)
7+
// RUN: %target-run-simple-swift(-I %S/Inputs -cxx-interoperability-mode=upcoming-swift -Xcc -std=c++23)
78

89
// REQUIRES: executable_test
910

0 commit comments

Comments
 (0)