File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
cpp/ql/src/semmle/code/cpp/internal Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -16,15 +16,8 @@ private predicate addressConstantVariable(Variable v) {
1616 addressConstantExpression ( v .getInitializer ( ) .getExpr ( ) .getFullyConverted ( ) ) and
1717 // Here we should also require that `v` is constexpr, but we don't have that
1818 // information in the db. See CPP-314. Instead, we require that the variable
19- // is not assigned to.
20- not exists ( VariableAccess va | va .getTarget ( ) = v |
21- // `v` may be assigned to, completely or partially
22- exists ( Expr lvalue | variableAccessedAsValue ( va , lvalue ) |
23- lvalue = any ( Assignment a ) .getLValue ( ) .getFullyConverted ( )
24- or
25- lvalue = any ( CrementOperation c ) .getOperand ( ) .getFullyConverted ( )
26- )
27- )
19+ // is never defined except in its initializer.
20+ forall ( Expr def | definition ( v , def ) | def = any ( Initializer init ) .getExpr ( ) )
2821}
2922
3023/**
You can’t perform that action at this time.
0 commit comments