mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
C++: Add new test case for template member change
We now output literals for accesses to members of template parameters:
So for `foo` in the following example:
```
template<typename T> void bar(T& t) {
T.foo(1)
}
```
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
|
||||
|
||||
class A {
|
||||
public:
|
||||
void foo();
|
||||
int k;
|
||||
};
|
||||
|
||||
class B {
|
||||
public:
|
||||
template <typename T>
|
||||
B(T x) {
|
||||
int k = x.k;
|
||||
x.foo();
|
||||
}
|
||||
};
|
||||
|
||||
A a;
|
||||
B b(a);
|
||||
@@ -0,0 +1,2 @@
|
||||
| test.cpp:13:15:13:15 | k |
|
||||
| test.cpp:14:7:14:9 | foo |
|
||||
@@ -0,0 +1,4 @@
|
||||
import cpp
|
||||
|
||||
from Literal l
|
||||
select l
|
||||
Reference in New Issue
Block a user