Skip to content

Reapply: Make CF_ENUM compatible with -Welaborated-enum-base #3082

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
Sep 27, 2021

Conversation

etcwilde
Copy link
Contributor

The syntax relied upon by CF_ENUM does not align with the intent of the C++ feature, and that correction extends to its use in C mode. Add a temporary fix that 'swallows' the user-supplied typealias by defining a dummy type, and then does a forward-definition-then-typedef-then-enum-opening dance to apply the correct syntax.

This patch was originally applied in d28b547, then was undone in d8e8a8b. -Welaborated-enum-base is taking effect on the swift rebranch branch, so we will need to fix the syntax before that lands.
Failing CI job: https://ci.swift.org/view/Swift%20rebranch/job/oss-swift-rebranch-incremental-RA-linux-ubuntu-18_04/26/console

The syntax relied upon by CF_ENUM does not align with the intent of the C++ feature, and that correction extends to its use in C mode. Add a temporary fix that 'swallows' the user-supplied `typealias` by defining a dummy type, and then does a forward-definition-then-typedef-then-enum-opening dance to apply the correct syntax.
@etcwilde etcwilde requested a review from millenomi September 25, 2021 00:23
@etcwilde
Copy link
Contributor Author

@swift-ci please test

@etcwilde
Copy link
Contributor Author

I'm going to go ahead and merge this now.

@etcwilde etcwilde merged commit 2e9d97d into swiftlang:main Sep 27, 2021
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