Skip to content

Commit ddf1ef8

Browse files
author
Matthew Gretton-Dann
committed
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) } ```
1 parent c0884e9 commit ddf1ef8

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
3+
class A {
4+
public:
5+
void foo();
6+
int k;
7+
};
8+
9+
class B {
10+
public:
11+
template <typename T>
12+
B(T x) {
13+
int k = x.k;
14+
x.foo();
15+
}
16+
};
17+
18+
A a;
19+
B b(a);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
| test.cpp:13:15:13:15 | k |
2+
| test.cpp:14:7:14:9 | foo |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import cpp
2+
3+
from Literal l
4+
select l

0 commit comments

Comments
 (0)