mirror of
https://github.com/github/codeql.git
synced 2026-05-05 13:45:19 +02:00
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. | ```
This commit is contained in:
@@ -171,6 +171,16 @@ class Reachability {
|
||||
static Reachability staticInstance;
|
||||
};
|
||||
|
||||
class Forgivable {
|
||||
// GOOD: wrong return type but that doesn't matter on a deleted function.
|
||||
Forgivable operator=(const Forgivable &_val) = delete;
|
||||
|
||||
private:
|
||||
// GOOD: wrong return type but that doesn't matter because this operator is
|
||||
// private and probably also unimplemented, so no code can call it.
|
||||
Forgivable operator=(int *_val);
|
||||
};
|
||||
|
||||
int main() {
|
||||
Container c;
|
||||
c = c;
|
||||
|
||||
Reference in New Issue
Block a user