Fixed clang 22 error with overloaded operator#1909
Fixed clang 22 error with overloaded operator#1909Farmer-Markus wants to merge 1 commit intoReturn-To-The-Roots:masterfrom
Conversation
| { | ||
| const Addon* addon = ggs.getAddon(i); | ||
| const bool isVisible = (addon->getGroups() & selection) != AddonGroup(0); | ||
| const bool isVisible = static_cast<unsigned>(addon->getGroups() & selection) != 0; |
There was a problem hiding this comment.
The intended way was this:
| const bool isVisible = static_cast<unsigned>(addon->getGroups() & selection) != 0; | |
| const bool isVisible = bitset::any(addon->getGroups(), selection); |
I.e. bitsets shouldn't be compared but only modified or checked unless we find a use case for that.
Or do you see anything I missed?
There was a problem hiding this comment.
Ups, missed that.
But I don't understand why the MAKE_BITSET_STRONG macro exists.
I mean what's the point of using it? Type safety or to prevent lines like the current one?
There was a problem hiding this comment.
A bit of all:
- Type safety: Only combine enumerators of same enum
- Typing: Allow combining of enum classes at all w/o
static_cast - Prevent unwanted operations:
bitset != bitsetis usually not what you want as you'd likely wanted to test bits or if bitsets overlap (non-empty union)
There was a problem hiding this comment.
A bit of all:
* Type safety: Only combine enumerators of same enum * Typing: Allow combining of enum classes at all w/o `static_cast` * Prevent unwanted operations: `bitset != bitset` is usually not what you want as you'd likely wanted to test bits or if bitsets overlap (non-empty union)
Ok thanks.
There is no bitset any implementation in enumUtils if that is what you meant.
And I thought my compiler is doing something weird since it just crashes without error messages. Very weird
4b0e5e4 to
d9acdbd
Compare
|
Actually the issue seems to be that you updated the submodule to a different version. The change from libutil is pulled in in #1890 where this issue is avoided too. Run |
I see :D |
Error: