Skip to content

Commit 413f49b

Browse files
authored
Query cpp/unused-static-variable was producing incorrect results for constexpr variables
1 parent d03aeca commit 413f49b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cpp/ql/src/Best Practices/Unused Entities/UnusedStaticVariables.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ from Variable v
2121
where
2222
v.isStatic() and
2323
v.hasDefinition() and
24+
not v.isConstexpr() and
2425
not exists(VariableAccess a | a.getTarget() = v) and
2526
not v instanceof MemberVariable and
2627
not declarationHasSideEffects(v) and

0 commit comments

Comments
 (0)