Skip to content

Add FlagSet::getField constexpr annotation #60637

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 13, 2022

Conversation

etcwilde
Copy link
Member

In the backdeploy library, ActiveTaskStatus takes JobFlags::getPriority() in the constexpr constructor; however, JobFlags::getPriority() isn't constexpr, so this is bad.

rdar://84050655

In the backdeploy library, `ActiveTaskStatus` takes
`JobFlags::getPriority()` in the constexpr constructor; however,
`JobFlags::getPriority()` isn't constexpr, so this is incorrect.
@etcwilde etcwilde requested a review from rjmccall August 19, 2022 01:44
@etcwilde
Copy link
Member Author

@swift-ci please test

@etcwilde
Copy link
Member Author

Admittedly, the rules around constexpr confuse me. I can't tell if this entirely qualifies for constexpr or not.
The constructor is constexpr, but setFlag is not and can mutate the state of Bits.

@etcwilde
Copy link
Member Author

@swift-ci please test Windows

Copy link
Contributor

@rjmccall rjmccall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be fine for these to be constexpr. The fact that there's no way to set these that's constexpr is unfortunate but something that would be nice to fix separately.

@etcwilde etcwilde merged commit 008bbe2 into swiftlang:main Sep 13, 2022
@etcwilde etcwilde deleted the ewilde/add-missing-constexprs branch September 13, 2022 23:49
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