Skip to content

Commit 2bc4199

Browse files
committed
[cxx-interop] Do not try to import std::chrono::tzdb, part 2
`tzdb` is declared inside of `namespace chrono`, so the check needs to be adjusted. rdar://126486849 / #73037
1 parent 15fd443 commit 2bc4199

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2650,11 +2650,12 @@ namespace {
26502650
return nullptr;
26512651
}
26522652

2653-
// Bail if this is `std::tzdb`. This type causes issues in copy
2653+
// Bail if this is `std::chrono::tzdb`. This type causes issues in copy
26542654
// constructor instantiation.
26552655
// FIXME: https://github.com/apple/swift/issues/73037
2656-
if (decl->isInStdNamespace() && decl->getIdentifier() &&
2657-
decl->getName() == "tzdb")
2656+
if (decl->getDeclContext()->isNamespace() &&
2657+
decl->getDeclContext()->getParent()->isStdNamespace() &&
2658+
decl->getIdentifier() && decl->getName() == "tzdb")
26582659
return nullptr;
26592660

26602661
auto &clangSema = Impl.getClangSema();

0 commit comments

Comments
 (0)