C++: Exclude commas from SwitchStmt.getExpr()

This commit is contained in:
Nora Dimitrijević
2022-09-30 12:31:55 +02:00
parent 4938de9185
commit 9a94222dbe

View File

@@ -45,7 +45,7 @@ predicate isParenthesized(CommaExpr ce) {
or
ce.isUnevaluated() // sizeof(), decltype(), alignof(), noexcept(), typeid()
or
ce.getParent*() = any(IfStmt i).getCondition()
ce.getParent*() = [any(IfStmt i).getCondition(), any(SwitchStmt s).getExpr()]
or
ce.getParent*() = [any(Loop l).getCondition(), any(ForStmt f).getUpdate()]
or