Skip to content

Commit fb4e418

Browse files
committed
Refactor get constexpr helper to public in unused variable qll and remove from ql.
1 parent 468eabd commit fb4e418

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

cpp/autosar/src/rules/M0-1-3/UnusedLocalVariable.ql

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ import cpp
1818
import codingstandards.cpp.autosar
1919
import codingstandards.cpp.deadcode.UnusedVariables
2020

21-
/** Gets the constant value of a constexpr/const variable. */
22-
private string getConstExprValue(Variable v) {
23-
result = v.getInitializer().getExpr().getValue() and
24-
(v.isConst() or v.isConstexpr())
25-
}
26-
2721
// This predicate is similar to getUseCount for M0-1-4 except that it also
2822
// considers static_asserts. This was created to cater for M0-1-3 specifically
2923
// and hence, doesn't attempt to reuse the M0-1-4 specific predicate

cpp/common/src/codingstandards/cpp/deadcode/UnusedVariables.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ predicate maybeACompileTimeTemplateArgument(Variable v) {
152152
}
153153

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

0 commit comments

Comments
 (0)