mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
CPP: Add a simplified test case for ImplicitThisFieldAccess.
This commit is contained in:
@@ -96,3 +96,22 @@ public:
|
||||
|
||||
int x, y;
|
||||
};
|
||||
|
||||
class MyHasDestructor1 {
|
||||
public:
|
||||
~MyHasDestructor1() {
|
||||
// ...
|
||||
}
|
||||
};
|
||||
|
||||
class MyHasDestructor2 {
|
||||
public:
|
||||
int x;
|
||||
MyHasDestructor1 v;
|
||||
|
||||
~MyHasDestructor2() {
|
||||
x++; // PointerFieldAccess, the `this->` is generated rather than implicit.
|
||||
|
||||
// ImplicitThisFieldAccess on call `v`s destructor.
|
||||
}
|
||||
};
|
||||
|
||||
@@ -24,3 +24,5 @@
|
||||
| FieldAccess.cpp:93:18:93:18 | y | ptr |
|
||||
| FieldAccess.cpp:94:11:94:11 | y | ptr |
|
||||
| FieldAccess.cpp:94:20:94:20 | y | val |
|
||||
| FieldAccess.cpp:113:5:113:5 | x | ptr |
|
||||
| FieldAccess.cpp:116:3:116:3 | v | this |
|
||||
|
||||
Reference in New Issue
Block a user