Skip to content

Commit 60c2e70

Browse files
Make another member of UnusedVariables.qll public for a ql query
1 parent 9cf4766 commit 60c2e70

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ class FullyDefinedClass extends Class {
8787
}
8888
}
8989

90+
class UserProvidedConstructorFieldInit extends ConstructorFieldInit {
91+
UserProvidedConstructorFieldInit() {
92+
not isCompilerGenerated() and
93+
not getEnclosingFunction().isCompilerGenerated()
94+
}
95+
}
96+
9097
/**
9198
* This module defines unused variables as defined by all standards, including MISRA C, C++, and
9299
* AUTOSAR.
@@ -206,13 +213,6 @@ predicate isUnused(Variable variable) {
206213
* and therefore not visible to us.
207214
*/
208215
module ThirdPassUnused {
209-
class UserProvidedConstructorFieldInit extends ConstructorFieldInit {
210-
UserProvidedConstructorFieldInit() {
211-
not isCompilerGenerated() and
212-
not getEnclosingFunction().isCompilerGenerated()
213-
}
214-
}
215-
216216
/**
217217
* Holds if `v` may hold a compile time value and is accessible to a template instantiation that
218218
* receives a constant value as an argument equal to the value of `v`.

0 commit comments

Comments
 (0)