Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9382c9d

Browse files
committed
C++: Regression tests for AV Rule 82
Without the last commit, this addition to the test gives the following results: ``` +| AV Rule 82.cpp:176:14:176:22 | operator= | Assignment operator in class Forgivable does not return a reference to *this. | +| AV Rule 82.cpp:181:14:181:22 | operator= | Assignment operator in class Forgivable does not return a reference to *this. | ```
1 parent da73a03 commit 9382c9d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

cpp/ql/test/query-tests/jsf/4.10 Classes/AV Rule 82/AV Rule 82.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,16 @@ class Reachability {
171171
static Reachability staticInstance;
172172
};
173173

174+
class Forgivable {
175+
// GOOD: wrong return type but that doesn't matter on a deleted function.
176+
Forgivable operator=(const Forgivable &_val) = delete;
177+
178+
private:
179+
// GOOD: wrong return type but that doesn't matter because this operator is
180+
// private and probably also unimplemented, so no code can call it.
181+
Forgivable operator=(int *_val);
182+
};
183+
174184
int main() {
175185
Container c;
176186
c = c;

0 commit comments

Comments
 (0)