Skip to content

[cxx-interop] Require lifetime annotations in safe mode #78771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

Xazax-hun
Copy link
Contributor

@Xazax-hun Xazax-hun commented Jan 21, 2025

In strict safe mode we should consider all C++ APIs with non-escapable parameters unsafe unless they have their lifetimes annotated. This can be done using [[clang::lifetimebound]], [[clang::lifetime_capture_by]], or [[clang::noescape]].

rdar://142814417

In strict safe mode we should consider all C++ APIs with non-escapable
parameters unsafe unless they have their lifetimes annotated. This can
be done using [[clang::lifetimebound]], [[clang::lifetime_capture_by]],
or [[clang::noescape]].
@Xazax-hun Xazax-hun added the c++ interop Feature: Interoperability with C++ label Jan 21, 2025
@Xazax-hun
Copy link
Contributor Author

@swift-ci please smoke test

@Xazax-hun
Copy link
Contributor Author

@swift-ci please smoke test linux

@Xazax-hun
Copy link
Contributor Author

@swift-ci please smoke test

@Xazax-hun Xazax-hun merged commit 795d629 into main Jan 22, 2025
3 checks passed
@Xazax-hun Xazax-hun deleted the gaborh/unsafe-lifetime-unannotated branch January 22, 2025 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants