Skip to content

[cherry-pick swift/release/6.0][Headers] Don't declare unreachable() from stddef.h in C++ #8557

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

ian-twilightcoder
Copy link

Even if __need_unreachable is set, stddef.h should not declare unreachable() in C++ because it conflicts with the declaration in .

rdar://125937171
(cherry picked from commit d23b918)

…from stddef.h in C++

Even if __need_unreachable is set, stddef.h should not declare unreachable() in C++ because it conflicts with the declaration in <utility>.

rdar://125937171
(cherry picked from commit d23b918)
@ian-twilightcoder
Copy link
Author

ian-twilightcoder commented Apr 9, 2024

Explanation: This change prevents clang's stddef.h declaring unreachable() in an incompatible manner in C++.
Radar (and possibly SR Issue): rdar://125937171
Scope: This only applies to cases where __need_unreachable is defined, which is rare, but it's still better to fix it before it becomes a problem.
Risk: None anticipated.
Testing: Local testing, CI
Reviewed By: Michael Spencer (Bigcheese)

@ian-twilightcoder
Copy link
Author

@swift-ci test llvm

@ian-twilightcoder
Copy link
Author

@swift-ci test

@fredriss fredriss merged commit 0514f4b into swiftlang:swift/release/6.0 Apr 10, 2024
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