Skip to content

[ClangImporter] Look through __ended_by and __null_terminated (#81630) #82003

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

Conversation

hnrklssn
Copy link
Contributor

@hnrklssn hnrklssn commented Jun 4, 2025

  • Explanation:
    Previously we would not import decls containing __null_terminated or __ended_by. This was not an issue, because they can only occur when -fbounds-safety or -fexperimental-bounds-safety-attributes is passed to clang. When SafeInteropWrappers is enabled we pass
    -fexperimental-bound-safety-attributes to clang however, so these types can now occur without the user specifying any -Xcc flags.

  • Scope:
    Variables and functions previously marked unavailable may now be available.

  • Issues:
    rdar://151611718

  • Original PRs:
    [ClangImporter] Look through __ended_by and __null_terminated #81630

  • Risk:
    Low, this just strips pointer type sugar

  • Testing:
    Added lots of (positive and negative) test cases of importing declarations with bounds information.

  • Reviewers:
    @egorzhdan

…ang#81630)

Previously we would not import decls containing these types. This was
not an issue, because they can only occur when -fbounds-safety or
-fexperimental-bounds-safety-attributes is passed to clang. When
SafeInteropWrappers is enabled we pass
-fexperimental-bound-safety-attributes to clang however, so these types
can now occur without the user specifying any -Xcc flags.

rdar://151611718
(cherry picked from commit ac068c2)
@hnrklssn hnrklssn requested a review from DougGregor June 4, 2025 23:01
@hnrklssn hnrklssn requested a review from a team as a code owner June 4, 2025 23:01
@hnrklssn
Copy link
Contributor Author

hnrklssn commented Jun 4, 2025

@swift-ci please test

@hnrklssn
Copy link
Contributor Author

hnrklssn commented Jun 5, 2025

@swift-ci please test

@hnrklssn
Copy link
Contributor Author

hnrklssn commented Jun 5, 2025

@swift-ci please test

@hnrklssn hnrklssn merged commit fc67649 into swiftlang:release/6.2 Jun 6, 2025
5 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.

2 participants