Skip to content

Commit 93c6169

Browse files
authored
Merge pull request #42103 from zoecarver/rip-out-operators
2 parents 4c2e88b + f652361 commit 93c6169

19 files changed

+38
-8
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4129,6 +4129,11 @@ namespace {
41294129
if (!dc)
41304130
return nullptr;
41314131

4132+
// Support for importing operators is temporarily disabled: rdar://91070109
4133+
if (decl->getDeclName().getNameKind() == clang::DeclarationName::CXXOperatorName &&
4134+
decl->getDeclName().getCXXOverloadedOperator() != clang::OO_Subscript)
4135+
return nullptr;
4136+
41324137
// Handle cases where 2 CXX methods differ strictly in "constness"
41334138
// In such a case append a suffix ("Mutating") to the mutable version
41344139
// of the method when importing to swift

test/Interop/Cxx/implementation-only-imports/check-operator-visibility-inversed.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// that the operator decl can be found when at least one of the
99
// modules is not `@_implementationOnly`.
1010

11+
// XFAIL: *
1112

1213
import UserA
1314
@_implementationOnly import UserB

test/Interop/Cxx/implementation-only-imports/check-operator-visibility.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// that the operator decl can be found when at least one of the
99
// modules is not `@_implementationOnly`.
1010

11+
// XFAIL: *
12+
1113
@_implementationOnly import UserA
1214
import UserB
1315

test/Interop/Cxx/namespace/free-functions-module-interface.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
// CHECK-NEXT: struct X {
88
// CHECK-NEXT: init()
99
// CHECK-NEXT: }
10-
// CHECK-NEXT: static func + (_: FunctionsNS1.X, _: FunctionsNS1.X) -> UnsafePointer<CChar>!
10+
// TODO: check this again when operators are re-enabled: rdar://91070109 (also please enable this in the execution test "free-functions.swift")
11+
// CHECK-NOT: static func +
1112
// CHECK-NEXT: static func sameNameInChild() -> UnsafePointer<CChar>!
1213
// CHECK-NEXT: static func sameNameInSibling() -> UnsafePointer<CChar>!
1314
// CHECK-NEXT: enum FunctionsNS2 {
@@ -20,7 +21,8 @@
2021
// CHECK-NEXT: static func definedInDefs() -> UnsafePointer<CChar>!
2122
// CHECK-NEXT: }
2223

23-
// CHECK-NEXT: static func + (_: FunctionsNS1.X, _: FunctionsNS1.X) -> UnsafePointer<CChar>!
24+
// TODO: check this again when operators are re-enabled: rdar://91070109 (also please enable this in the execution test "free-functions.swift")
25+
// CHECK-NOT: static func +
2426

2527
// CHECK-NEXT: enum FunctionsNS4 {
2628
// CHECK-NEXT: static func sameNameInSibling() -> UnsafePointer<CChar>!

test/Interop/Cxx/namespace/free-functions.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ NamespacesTestSuite.test("Basic functions") {
2020
expectEqual(String(cString: basicFunctionLowestLevelCString!),
2121
"FunctionsNS1::FunctionsNS2::FunctionsNS3::basicFunctionLowestLevel")
2222

23-
let x = FunctionsNS1.X()
24-
expectEqual(String(cString: x + x),
25-
"FunctionsNS1::operator+(X, X)")
23+
// TODO: check this again when operators are re-enabled: rdar://91070109
24+
// let x = FunctionsNS1.X()
25+
// expectEqual(String(cString: x + x),
26+
// "FunctionsNS1::operator+(X, X)")
2627
}
2728

2829
NamespacesTestSuite.test("Forward declared functions") {

test/Interop/Cxx/operators/member-inline-irgen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-cxx-interop | %FileCheck %s
22
//
33
// We can't yet call member functions correctly on Windows (SR-13129).
4-
// XFAIL: OS=windows-msvc
4+
// XFAIL: *
55

66
import MemberInline
77

test/Interop/Cxx/operators/member-inline-module-interface.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %target-swift-ide-test -print-module -module-to-print=MemberInline -I %S/Inputs -source-filename=x -enable-cxx-interop | %FileCheck %s
2+
// XFAIL: *
23

34
// CHECK: struct LoadableIntWrapper {
45
// CHECK: static func - (lhs: inout LoadableIntWrapper, rhs: LoadableIntWrapper) -> LoadableIntWrapper

test/Interop/Cxx/operators/member-inline-silgen.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %target-swift-emit-sil %s -I %S/Inputs -enable-cxx-interop | %FileCheck %s
2+
// XFAIL: *
23

34
import MemberInline
45

test/Interop/Cxx/operators/member-inline-typechecker.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %target-typecheck-verify-swift -I %S/Inputs -enable-cxx-interop
2+
// XFAIL: *
23

34
import MemberInline
45

test/Interop/Cxx/operators/member-inline.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-cxx-interop)
22

33
// REQUIRES: executable_test
4-
// XFAIL: OS=linux-android
4+
// XFAIL: *
55

66
import MemberInline
77
import StdlibUnittest

0 commit comments

Comments
 (0)