Skip to content
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

[Clang] Permit noescape on non-pointer types #9789

Open
wants to merge 1 commit into
base: stable/20240723
Choose a base branch
from

Conversation

Xazax-hun
Copy link

In modern C++ we often use span, string_view or other view objects instead of raw pointers. This PR opens the door to mark those noescape. This can be useful to document the API contracts, for interop with memory safe languages like Swift or Rust, and possibly in the future to implement take this into account in codegen.

The PR also adds a feature test macro. The goal is to help avoiding warnings when the code is compiler by earlier versions of clang that does not permit this attribute on non-pointer types.

rdar://140196481

In modern C++ we often use span, string_view or other view objects instead of
raw pointers. This PR opens the door to mark those noescape. This can be useful
to document the API contracts, for interop with memory safe languages like
Swift or Rust, and possibly in the future to implement take this into account
in codegen.

The PR also adds a feature test macro. The goal is to help avoiding warnings
when the code is compiler by earlier versions of clang that does not permit
this attribute on non-pointer types.

rdar://140196481
@Xazax-hun Xazax-hun requested a review from a team as a code owner December 23, 2024 15:27
@Xazax-hun
Copy link
Author

I am not sure yet if this would land upstream, but we definitely need this downstream. Upstream PR: llvm#117344

@Xazax-hun Xazax-hun requested a review from egorzhdan December 23, 2024 15:28
@Xazax-hun
Copy link
Author

@swift-ci please test LLVM

@Xazax-hun
Copy link
Author

@swift-ci please test

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.

1 participant