Skip to content

Commit fdc0632

Browse files
committed
[interop][SwiftToCxx] do not emit domain ObjC error values in C++ mode
1 parent cb31700 commit fdc0632

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lib/PrintAsClang/ModuleContentsWriter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,8 @@ class ModuleWriter {
561561

562562
SmallVector<ProtocolConformance *, 1> conformances;
563563
auto errorTypeProto = ctx.getProtocol(KnownProtocolKind::Error);
564-
if (ED->lookupConformance(errorTypeProto, conformances)) {
564+
if (outputLangMode != OutputLanguageMode::Cxx
565+
&& ED->lookupConformance(errorTypeProto, conformances)) {
565566
bool hasDomainCase = std::any_of(ED->getAllElements().begin(),
566567
ED->getAllElements().end(),
567568
[](const EnumElementDecl *elem) {

test/Interop/SwiftToCxx/functions/swift-functions-errors.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
// CHECK: }
1515

16-
// XFAIL: *
17-
1816
@_expose(Cxx)
1917
public enum NaiveErrors : Error {
2018
case returnError

0 commit comments

Comments
 (0)