mirror of
https://github.com/github/codeql.git
synced 2026-04-26 09:15:12 +02:00
C++: Add destructor test cases for AV Rule 114
This commit is contained in:
@@ -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 |
|
||||
|
||||
@@ -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]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user