Skip to content

Commit db276dc

Browse files
committed
Avoid the default case by asserting the existence of case expr
1 parent 538fafa commit db276dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cpp/misra/src/rules/RULE-10-2-3/UnscopedEnumWithoutFixedUnderlyingTypeUsed.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ predicate switchConditionIsAnUnfixedEnumVariant(SwitchStmt switch, Enum enum, Sw
184184
isUnscopedEnumWithoutFixedUnderlyingType(enum) and
185185
enum = switch.getExpr().getType() and
186186
invalidCase = switch.getASwitchCase() and
187-
not invalidCase.getExpr().getUnderlyingType() = enum
187+
invalidCase.getExpr().getUnderlyingType() != enum
188188
}
189189

190190
/**

0 commit comments

Comments
 (0)