\[~tamas.vajk] I know that as written this rule doesn't cover _BitwiseOperatorOnEnumWithoutFlags_ but IMO it obviates it. According to http://stackoverflow.com/a/8480/2662707[SO] the ``++[Flags]++`` doesn't actually get you anything w/r/t bitwise usage. What's important is the assigned values.
I propose a Minor followup rule to make sure that ``++[Flags]++`` is applied when the enum values are power-of-2.
IMO it should be another rule (a MINOR one) that suggests to mark power-of-two Enums with ``++Flags++`` - that knowledge cannot just sneak into this rule's issue message [~ann.campbell.2].
\[~ann.campbell.2] We discussed it with [~dinesh.bolkensteyn] and he convinced me that we should have a minor severity rule that proposes to use the ``++[Flags]++`` whenever an enum only contains power-of-two items. (We can't merge that one into this issue, because of the different severity, but has a value, because it improves the understability of the code)
\[~ann.campbell.2] I reopened this RSPEC. I'm going through the R# rules, and I think it would still make sense. Note that the rule was closed because we realized that flags enums can't be forced to have only power of two values. So I removed that part, and only left the bitwise operation part in the rule. WDYT?
\[~ann.campbell.2] I see the point of marking the declaration noncompliant, but from a user perspective it would be better on the call:
Let's say we mark the `enum` noncompliant, and say that it should not be used as flags, if it's not marked with `[Flags]`. But the developer would need some verification that indeed it's used somewhere in a binary or/and. So we would probably include a filename and line number in the issue message. And then the dev could go check it there, and then come back to the declaration and fix it.
While in the other case if the usage is marked, the dev would only need to go to the definition, which is just one shortcut away.
If we're going to do that [~tamas.vajk], then we need to flip the rule around: "Non-flags enums should not be used in bitwise operations" (note double-negative).