mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This change makes ClangImporter import some C++ member functions as non-mutating, given that they satisfy two requirements: * the function itself is marked as `const` * the parent struct doesn't contain any `mutable` members `get` accessors of subscript operators are now also imported as non-mutating if the C++ `operator[]` satisfies the requirements above. Fixes SR-12795.
16 lines
670 B
Swift
16 lines
670 B
Swift
// RUN: %target-swift-ide-test -print-module -module-to-print=UsingDirective -I %S/Inputs -source-filename=x -enable-cxx-interop | %FileCheck %s
|
|
|
|
// CHECK: struct __CxxTemplateInst12MagicWrapperI10IntWrapperE {
|
|
// CHECK-NEXT: var t: IntWrapper
|
|
// CHECK-NEXT: init()
|
|
// CHECK-NEXT: init(t: IntWrapper)
|
|
// CHECK-NEXT: func getValuePlusArg(_ arg: Int32) -> Int32
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: struct IntWrapper {
|
|
// CHECK-NEXT: var value: Int32
|
|
// CHECK-NEXT: init()
|
|
// CHECK-NEXT: init(value: Int32)
|
|
// CHECK-NEXT: func getValue() -> Int32
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: typealias UsingWrappedMagicNumber = __CxxTemplateInst12MagicWrapperI10IntWrapperE
|