Skip to content

Sema: Only diagnose explicit unavailable Clang enum elements #77254

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

Conversation

tshortli
Copy link
Contributor

#77236 caused a source compatibility regression because extractEnumElement() does not suppress its diagnostics in the context of pattern matching. Potentially unavailable enum elements should not be diagnosed when pattern matching since the generated code will not retrieve the potentially unavailable element value on versions where it is unavailable.

Fixes rdar://138771328.

swiftlang#77236 caused a source compatibility
regression because `extractEnumElement()` does not suppress its diagnostics in
the context of pattern matching. Potentially unavailable enum elements should
not be diagnosed when pattern matching since the generated code will not
retrieve the potentially unavailable element value on versions where it is
unavailable.

Fixes rdar://138771328.
@tshortli
Copy link
Contributor Author

@swift-ci please smoke test

@tshortli
Copy link
Contributor Author

@swift-ci please test source compatibility

@tshortli tshortli enabled auto-merge October 28, 2024 18:05
@tshortli
Copy link
Contributor Author

@swift-ci please smoke test Windows

@tshortli tshortli merged commit 1499229 into swiftlang:main Oct 29, 2024
5 checks passed
@tshortli tshortli deleted the extract-clang-enum-element-versioned-availability branch October 29, 2024 02:46
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