Skip to content

Commit 92df1f7

Browse files
authored
Merge pull request github#5165 from criemen/bsl-model-identity
C++: Refactor IdentityFunction.qll.
2 parents 9499edf + f79b314 commit 92df1f7

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

cpp/ql/src/semmle/code/cpp/models/implementations/IdentityFunction.qll

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@ import semmle.code.cpp.models.interfaces.SideEffect
66
/**
77
* The standard function templates `std::move` and `std::forward`.
88
*/
9-
private class IdentityFunction extends DataFlowFunction, SideEffectFunction, AliasFunction {
10-
IdentityFunction() {
11-
this.getNamespace().getParentNamespace() instanceof GlobalNamespace and
12-
this.getNamespace().getName() = "std" and
13-
this.getName() = ["move", "forward"]
14-
}
9+
private class IdentityFunction extends DataFlowFunction, SideEffectFunction, AliasFunction,
10+
FunctionTemplateInstantiation {
11+
IdentityFunction() { this.hasQualifiedName("std", ["move", "forward"]) }
1512

1613
override predicate hasOnlySpecificReadSideEffects() { any() }
1714

0 commit comments

Comments
 (0)