Skip to content

Commit fe6e8ec

Browse files
authored
Merge pull request #63294 from hyp/eng/ntd-crash-fix
[interop] verify that a C++ record is a Swift nominal type before try…
2 parents b4e1e52 + 25bcd26 commit fe6e8ec

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2611,7 +2611,8 @@ namespace {
26112611
conformToCxxSequenceIfNeeded(Impl, nominalDecl, decl);
26122612
}
26132613

2614-
addExplicitProtocolConformances(cast<NominalTypeDecl>(result));
2614+
if (auto *ntd = dyn_cast<NominalTypeDecl>(result))
2615+
addExplicitProtocolConformances(ntd);
26152616

26162617
return result;
26172618
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// RUN: %target-swift-ide-test -print-module -module-to-print=Foundation -I %S/Inputs -source-filename=x -enable-experimental-cxx-interop -enable-objc-interop
2+
3+
// REQUIRES: OS=macosx

0 commit comments

Comments
 (0)