Skip to content

Commit

Permalink
Merge pull request #16017 from jketema/destructors21
Browse files Browse the repository at this point in the history
C++: Add destructor test cases for AV Rule 114
  • Loading branch information
jketema authored Mar 22, 2024
2 parents eca6c00 + 3f0ce98 commit fb4ed39
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
| test.cpp:112:1:112:1 | return ... | Function g14 should return a value of type int but does not return a value here |
| test.cpp:134:2:134:36 | ExprStmt | Function g16 should return a value of type int but does not return a value here |
| test.cpp:141:3:141:37 | ExprStmt | Function g17 should return a value of type int but does not return a value here |
| test.cpp:189:2:189:16 | ExprStmt | Function g23 should return a value of type int but does not return a value here |
18 changes: 18 additions & 0 deletions cpp/ql/test/query-tests/jsf/4.13 Functions/AV Rule 114/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,21 @@ int g19(int x)
int g21() {
g20(); // GOOD
}

class Aborting {
public:
[[noreturn]]
~Aborting();

void a() {};
};

int g22() {
Aborting x;

x.a(); // GOOD
}

int g23() {
Aborting().a(); // GOOD [FALSE POSITIVE]
}

0 comments on commit fb4ed39

Please sign in to comment.