-
Notifications
You must be signed in to change notification settings - Fork 1.7k
C++: Support <
reasoning for switch
statements in Guards library
#15980
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
I'm assuming |
It's valid: https://ideone.com/uMpD6M 😄 |
Oh, it some gcc extension https://godbolt.org/z/Wvqc1ceTs |
My head is starting to spin a bit 😅 This adds more cases that look very similar to the cases that were already there, so I tend to believe this is all correct, but it feels a bit subtle. |
That's very fair! Yeah, there are many predicates that does similar things in this file. Before my changes we had:
and now that we're supporting which means we basically have 4 groups that look very much the same, and have basically the same set of cases, but subtle differ in what the base cases does. It may be possible to define a parameterized module to group some of 1. and 2. together and another parameterized module to group some of a. and b. together. Ideally, we'd want to group 1. and a. together, and 2. and b. together, but since they deal with different number of parameters (since one is "binary" and one is "unary") I'm not sure it'll be very easy 😢 |
This is the final PR we need to fully support
switch
statement support in the Guards library 🎉 This PR is the<
version of #15958 that ensures that we can know the lower and upper bounds given bycase
statements such as:Commit-by-commit review recommended