Skip to content

Commit 0fcd2c4

Browse files
committed
Update tests files
1 parent 2a4988e commit 0fcd2c4

4 files changed

Lines changed: 9 additions & 32 deletions

File tree

‎cpp/cert/src/rules/EXP50-CPP/DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import cpp
2020
import codingstandards.cpp.cert
2121
import codingstandards.cpp.SideEffect
22-
import semmle.code.cpp.dataflow.TaintTracking
22+
import semmle.code.cpp.dataflow.new.TaintTracking
2323
import semmle.code.cpp.valuenumbering.GlobalValueNumbering
2424

2525
/** Holds if the function's return value is derived from the `AliasParamter` p. */
@@ -73,6 +73,8 @@ predicate returnValueDependsOnMemberVariable(MemberFunction f, MemberVariable v)
7373
v.getDeclaringType() = f.getDeclaringType()
7474
|
7575
TaintTracking::localTaint(DataFlow::exprNode(va), DataFlow::exprNode(ret.getExpr()))
76+
or
77+
ret.getExpr().getAChild*() = va
7678
)
7779
}
7880

‎cpp/cert/test/rules/EXP50-CPP/DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.expected‎

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,3 @@
1-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql:28,31-39)
2-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql:28,59-67)
3-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql:31,33-41)
4-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql:31,57-65)
5-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql:35,33-41)
6-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql:35,59-67)
7-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql:44,5-13)
8-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql:44,25-33)
9-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql:44,53-61)
10-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql:47,31-39)
11-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql:47,57-65)
12-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql:56,31-39)
13-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql:56,55-63)
14-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql:63,31-39)
15-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql:63,57-65)
16-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql:75,31-39)
17-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql:75,55-63)
18-
WARNING: module 'TaintTracking' has been deprecated and may be removed in future (DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql:28,5-18)
19-
WARNING: module 'TaintTracking' has been deprecated and may be removed in future (DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql:31,7-20)
20-
WARNING: module 'TaintTracking' has been deprecated and may be removed in future (DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql:35,7-20)
21-
WARNING: module 'TaintTracking' has been deprecated and may be removed in future (DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql:47,5-18)
22-
WARNING: module 'TaintTracking' has been deprecated and may be removed in future (DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql:56,5-18)
23-
WARNING: module 'TaintTracking' has been deprecated and may be removed in future (DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql:63,5-18)
24-
WARNING: module 'TaintTracking' has been deprecated and may be removed in future (DoNotDependOnTheOrderOfEvaluationForSideEffectsInFunctionCallsAsFunctionArguments.ql:75,5-18)
251
| test.cpp:82:3:82:4 | call to f2 | Depending on the order of evaluation for the arguments $@ and $@ for side effects on shared state is unspecified and can result in unexpected behavior. | test.cpp:82:6:82:7 | call to f5 | call to f5 | test.cpp:82:12:82:13 | call to f6 | call to f6 |
262
| test.cpp:84:3:84:4 | call to f2 | Depending on the order of evaluation for the arguments $@ and $@ for side effects on shared state is unspecified and can result in unexpected behavior. | test.cpp:84:6:84:7 | call to f5 | call to f5 | test.cpp:84:12:84:13 | call to f7 | call to f7 |
273
| test.cpp:87:3:87:4 | call to f2 | Depending on the order of evaluation for the arguments $@ and $@ for side effects on shared state is unspecified and can result in unexpected behavior. | test.cpp:87:9:87:10 | call to m1 | call to m1 | test.cpp:87:18:87:19 | call to m1 | call to m1 |

‎cpp/common/test/rules/unusedtypedeclarations/UnusedTypeDeclarations.expected‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
| test.cpp:13:11:13:11 | D | Type declaration D is not used. |
44
| test.cpp:77:11:77:11 | R | Type declaration R is not used. |
55
| test.cpp:90:12:90:12 | (unnamed class/struct/union) | Type declaration (unnamed class/struct/union) is not used. |
6-
| test.cpp:112:29:112:30 | AA | Type declaration AA is not used. |
7-
| test.cpp:127:7:127:12 | Nested | Type declaration Nested is not used. |
8-
| test.cpp:136:9:136:20 | UnusedNested | Type declaration UnusedNested is not used. |
9-
| test.cpp:139:7:139:22 | NestedBlockScope | Type declaration NestedBlockScope is not used. |
10-
| test.cpp:150:11:150:16 | Unused | Type declaration Unused is not used. |
6+
| test.cpp:111:29:111:30 | AA | Type declaration AA is not used. |
7+
| test.cpp:126:7:126:12 | Nested | Type declaration Nested is not used. |
8+
| test.cpp:135:9:135:20 | UnusedNested | Type declaration UnusedNested is not used. |
9+
| test.cpp:138:7:138:22 | NestedBlockScope | Type declaration NestedBlockScope is not used. |
10+
| test.cpp:149:11:149:16 | Unused | Type declaration Unused is not used. |

‎cpp/common/test/rules/unusedtypedeclarations/test.cpp‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ template <class T> class X { // COMPLIANT - template class never instantiated
107107
template <class T> class Y {}; // COMPLIANT - used in the test case below
108108

109109
// Alias templates
110-
template <typename T> using Z = Y<T>; // COMPLIANT - used below
111-
110+
template <typename T> using Z = Y<T>; // COMPLIANT - used below
112111
template <typename T> using AA = Y<T>; // NON_COMPLIANT - never instantiated
113112

114113
void test_alias_template() { Z<int> v; }

0 commit comments

Comments
 (0)