Skip to content

Conversation

@fahadnayyar
Copy link
Contributor

Updating the C++ interop documentation by clarifying ownership and initialization semantics for SWIFT_SHARED_REFERENCE types. This change is documenting:

  • Guarantees and assumptions when SWIFT_SHARED_REFERENCE types are passed as parameters from Swift to C++ functions or methods.
  • How SWIFT_RETURNS_RETAINED and SWIFT_RETURNS_UNRETAINED can be used to specity ownership of returned values in C++ APIs returning SWIFT_SHARED_REFERENCE types.
  • Propagation of foreign reference annotations to inherited C++ types.
  • Swift initializer support for C++ constructors and static factory methods of SWIFT_SHARED_REFERENCE types annotated with SWIFT_NAME.

@fahadnayyar
Copy link
Contributor Author

@shahmishal this patch should now be ready to merged!

CC: @ravikandhadai

@egorzhdan egorzhdan merged commit 7e1ba94 into swiftlang:main Jul 10, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants