Files
swift-mirror/test/Interop/Cxx/class/mutable-members-module-interface.swift
Egor Zhdan 0e8ef4c05c [cxx-interop] Update tests for mutable struct fields
Methods that are marked as `const` in C++ can still modify a field of the object if the field is marked as `mutable`.

We previously imported all methods of structs with mutable fields as mutating in Swift. Unfortunately this doesn't work well with libstdc++, which uses mutable fields for some commonly used container types.

Our current user model assumes that we trust the `const` keyword on a C++ method, and import them as non-mutating in Swift. Let's make sure the tests reflect that.
2023-04-03 21:46:56 +01:00

11 lines
349 B
Swift

// RUN: %target-swift-ide-test -print-module -module-to-print=MutableMembers -I %S/Inputs -source-filename=x -enable-experimental-cxx-interop | %FileCheck %s
// CHECK: struct HasPublicMutableMember {
// CHECK: func foo() -> Int32
// CHECK: var a: Int32
// CHECK: }
// CHECK: struct HasPrivateMutableMember {
// CHECK: func bar()
// CHECK: }