mirror of
https://github.com/github/codeql.git
synced 2026-05-22 23:27:09 +02:00
C++: Add test for implicit this
This commit is contained in:
9
cpp/ql/test/library-tests/variables/this/this.cpp
Normal file
9
cpp/ql/test/library-tests/variables/this/this.cpp
Normal file
@@ -0,0 +1,9 @@
|
||||
class TestImplicitThis
|
||||
{
|
||||
public:
|
||||
int field;
|
||||
|
||||
int get() const {
|
||||
return field + this->field + get() + this->get();
|
||||
}
|
||||
};
|
||||
2
cpp/ql/test/library-tests/variables/this/this.expected
Normal file
2
cpp/ql/test/library-tests/variables/this/this.expected
Normal file
@@ -0,0 +1,2 @@
|
||||
| this.cpp:7:16:7:20 | this |
|
||||
| this.cpp:7:38:7:40 | this |
|
||||
5
cpp/ql/test/library-tests/variables/this/this.ql
Normal file
5
cpp/ql/test/library-tests/variables/this/this.ql
Normal file
@@ -0,0 +1,5 @@
|
||||
import cpp
|
||||
|
||||
from ThisExpr te
|
||||
where te.isCompilerGenerated()
|
||||
select te
|
||||
Reference in New Issue
Block a user