Skip to content

Commit

Permalink
Refactor get constexpr helper to public in unused variable qll and re…
Browse files Browse the repository at this point in the history
…move from ql.
  • Loading branch information
fjatWbyT committed Sep 16, 2024
1 parent 468eabd commit fb4e418
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions cpp/autosar/src/rules/M0-1-3/UnusedLocalVariable.ql
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ import cpp
import codingstandards.cpp.autosar
import codingstandards.cpp.deadcode.UnusedVariables

/** Gets the constant value of a constexpr/const variable. */
private string getConstExprValue(Variable v) {
result = v.getInitializer().getExpr().getValue() and
(v.isConst() or v.isConstexpr())
}

// This predicate is similar to getUseCount for M0-1-4 except that it also
// considers static_asserts. This was created to cater for M0-1-3 specifically
// and hence, doesn't attempt to reuse the M0-1-4 specific predicate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ predicate maybeACompileTimeTemplateArgument(Variable v) {
}

/** Gets the constant value of a constexpr/const variable. */
private string getConstExprValue(Variable v) {
string getConstExprValue(Variable v) {
result = v.getInitializer().getExpr().getValue() and
(v.isConst() or v.isConstexpr())
}
Expand Down

0 comments on commit fb4e418

Please sign in to comment.