File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
cpp/misra/src/rules/RULE-10-2-2 Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 1717import cpp
1818import codingstandards.cpp.misra
1919
20- class MemberUnscopedEnum extends Enum {
21- MemberUnscopedEnum ( ) {
22- not this instanceof ScopedEnum and
23- exists ( Class klass | klass = this .getEnclosingElement ( ) )
24- }
20+ class NestedUnscopedEnum extends Enum , NestedEnum {
21+ NestedUnscopedEnum ( ) { not this instanceof ScopedEnum }
2522}
2623
2724from Enum enum
2825where
2926 not isExcluded ( enum , Banned2Package:: unscopedEnumerationsShouldNotBeDeclaredQuery ( ) ) and
30- not ( enum instanceof ScopedEnum or enum instanceof MemberUnscopedEnum )
27+ not ( enum instanceof ScopedEnum or enum instanceof NestedUnscopedEnum )
3128select enum , "This enumeration is an unscoped enum not enclosed in a class or a struct."
You can’t perform that action at this time.
0 commit comments