mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This gives projects using C++ interop compat mode 5.9 access to the new features such as virtual methods and move-only types. rdar://126485814
37 lines
1.4 KiB
Swift
37 lines
1.4 KiB
Swift
// RUN: %target-swift-ide-test -print-module -cxx-interoperability-mode=swift-5.9 -print-implicit-attrs -module-to-print=VirtualMethods -I %S/Inputs -source-filename=x | %FileCheck %s
|
|
// RUN: %target-swift-ide-test -print-module -cxx-interoperability-mode=swift-6 -print-implicit-attrs -module-to-print=VirtualMethods -I %S/Inputs -source-filename=x | %FileCheck %s
|
|
// RUN: %target-swift-ide-test -print-module -cxx-interoperability-mode=upcoming-swift -print-implicit-attrs -module-to-print=VirtualMethods -I %S/Inputs -source-filename=x | %FileCheck %s
|
|
|
|
// CHECK: struct Base {
|
|
// CHECK-NEXT: @available(*, unavailable, message: "constructors of abstract C++ classes are unavailable in Swift")
|
|
// CHECK-NEXT: init()
|
|
// CHECK-NEXT: @available(*, unavailable, message: "virtual function is not available in Swift because it is pure")
|
|
// CHECK-NEXT: mutating func foo()
|
|
// CHECK: }
|
|
|
|
// CHECK: struct Base3 {
|
|
// CHECK-NEXT: init()
|
|
// CHECK: }
|
|
|
|
// CHECK: struct Derived2 {
|
|
// CHECK-NEXT: init()
|
|
// CHECK: }
|
|
|
|
// CHECK: struct Derived<CInt> {
|
|
// CHECK-NEXT: init()
|
|
// CHECK-NEXT: mutating func foo()
|
|
// CHECK: }
|
|
|
|
// CHECK: struct VirtualNonAbstractBase {
|
|
// CHECK-NEXT: init()
|
|
// CHECK-NEXT: func nonAbstractMethod()
|
|
|
|
// CHECK: class ImmortalBase {
|
|
// CHECK: func get42() -> Int32
|
|
// CHECK: func getOverridden42() -> Int32
|
|
// CHECK: }
|
|
// CHECK: class Immortal {
|
|
// CHECK: func getOverridden42() -> Int32
|
|
// CHECK: func get42() -> Int32
|
|
// CHECK: }
|