Files
swift-mirror/test/Interop/Cxx/templates/using-directive-module-interface.swift
Egor Zhdan a8f126f7cd C++ Interop: import const methods as non-mutating
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.
2021-07-25 15:18:33 +03:00

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