Files
swift-mirror/test/Interop/Cxx/class/mutability-annotations-module-interface.swift
Egor Zhdan 06612934e8 C++ Interop: support mutating attribute for C++ methods
This change teaches ClangImporter to import C++ methods marked with `__attribute__((__swift_attr__("mutating")))` as mutating in Swift. This is useful, for example, when a method mutates `this` despite being `const` in C++ (e.g. via `const_cast`).
2021-11-29 21:13:16 +03:00

8 lines
367 B
Swift

// RUN: %target-swift-ide-test -print-module -module-to-print=MutabilityAnnotations -I %S/Inputs -source-filename=x -enable-cxx-interop | %FileCheck %s
// CHECK: struct HasConstMethodAnnotatedAsMutating {
// CHECK: mutating func annotatedMutating() -> Int32
// CHECK: mutating func annotatedMutatingWithOtherAttrs() -> Int32
// CHECK: var a: Int32
// CHECK: }