Skip to content

Commit 9a94222

Browse files
committed
C++: Exclude commas from SwitchStmt.getExpr()
1 parent 4938de9 commit 9a94222

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cpp/ql/src/Best Practices/Likely Errors/CommaBeforeMisleadingIndentation.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ predicate isParenthesized(CommaExpr ce) {
4545
or
4646
ce.isUnevaluated() // sizeof(), decltype(), alignof(), noexcept(), typeid()
4747
or
48-
ce.getParent*() = any(IfStmt i).getCondition()
48+
ce.getParent*() = [any(IfStmt i).getCondition(), any(SwitchStmt s).getExpr()]
4949
or
5050
ce.getParent*() = [any(Loop l).getCondition(), any(ForStmt f).getUpdate()]
5151
or

0 commit comments

Comments
 (0)