This patch introduces a new attribute, flag_enum, which indicates to the compiler that an enumerator is a flag type. Compiler warnings about the range of values are adjusted accordingly.
Details
Details
- Reviewers
- None
Diff Detail
Diff Detail
Event Timeline
Comment Actions
This fixes most of the comments from Aaron Ballman.
I've left the C++ attribute syntax off, as I haven't yet considered the semantics in C++ carefully.
Comment Actions
Sean and I spoke on IRC about this review, and the items we came up with were:
- Move the FlagBits value off EnumDecl and into the FlagEnumAttr itself
- Rangeify a for loop
- Remove another spurious call to getName()
~Aaron
Comment Actions
A few more comments from Aaron.
On the C++ side, I realized that forward declarations and redeclarations possibly break everything. I don't want to think about that now. It could be made an error in C++ for the time being if that's a large concern, or I could simply work on FIXMEs or a later patch to make it work in C++.