-
Notifications
You must be signed in to change notification settings - Fork 719
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
C++11 enums don’t work as integer constants as expected #5554
Comments
Just my 2c, but I think |
would you care to elaborate on the "much to be desired" ? |
Sure. As used currently, people often declare an |
you can use them as bit flags, you just need to declare the bitwise operators for them. I think its great because it stops you "accidentally" bitwise-op'ing unrelated bitflags.
thats kinda why we have a |
HLSL 2017 and later all support C++11-style Can you provide an example of what doesn't work for you? The link you provided doesn't actually have an |
yeah when you change the |
I’ve transferred this issue over to DXC because this is a bug not a language feature request. |
enum class
)
hmm it works with correct The only annoying thing is that DXC doesn't recognize |
btw also seems that concepts like |
Is your feature request related to a problem? Please describe.
Thanks to HLSL2021 I can share enumeration declarations between C++ and HLSL202x.
Bug Report: However whenever I declare the
enum class
HLSL does not complain until I actually try to use the scoped enum. Seems thatenum class
passes through your tokenizer unharmed, but then the rest of the logic is gone.Describe the solution you'd like
For the compiler to support scope enum lookup
enum_t::
without errors.Describe alternatives you've considered
Not using scoped enums but a lot of my C++ code I want to expose to HLSL already does, so not fun.
Additional context
Here's a repro:
https://godbolt.org/z/1TdYh9E1a
The text was updated successfully, but these errors were encountered: