Skip to content

Commit d644150

Browse files
committed
C++: Test for template pointer-to-member CFG
1 parent 0f27310 commit d644150

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

cpp/ql/test/library-tests/syntax-zoo/pointer_to_member.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,13 @@ void pmIsConst() {
3535
void (PM::* pm2)();
3636
} pms = { &PM::x1, &PM::f1 };
3737
}
38+
39+
template<typename T>
40+
void pmIsConstT() {
41+
static const struct {
42+
int T::* pm1;
43+
void (T::* pm2)();
44+
} pms = { &T::x1, &T::f1 };
45+
}
46+
47+
template void pmIsConstT<PM>();
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
| pointer_to_member__pmIsConstT | pointer_to_member.cpp:41:3:44:29 | declaration | pointer_to_member.cpp:44:11:44:28 | initializer for pms | Standard edge, only from QL | uninstantiated |
2+
| pointer_to_member__pmIsConstT | pointer_to_member.cpp:41:3:44:29 | declaration | pointer_to_member.cpp:45:1:45:1 | return ... | Standard edge, only from extractor | uninstantiated |
3+
| pointer_to_member__pmIsConstT | pointer_to_member.cpp:44:11:44:28 | initializer for pms | pointer_to_member.cpp:44:14:44:18 | Unknown literal | Standard edge, only from QL | uninstantiated |
4+
| pointer_to_member__pmIsConstT | pointer_to_member.cpp:44:11:44:28 | {...} | pointer_to_member.cpp:45:1:45:1 | return ... | Standard edge, only from QL | uninstantiated |
5+
| pointer_to_member__pmIsConstT | pointer_to_member.cpp:44:13:44:18 | & ... | pointer_to_member.cpp:44:22:44:26 | Unknown literal | Standard edge, only from QL | uninstantiated |
6+
| pointer_to_member__pmIsConstT | pointer_to_member.cpp:44:14:44:18 | Unknown literal | pointer_to_member.cpp:44:13:44:18 | & ... | Standard edge, only from QL | uninstantiated |
7+
| pointer_to_member__pmIsConstT | pointer_to_member.cpp:44:21:44:26 | & ... | pointer_to_member.cpp:44:11:44:28 | {...} | Standard edge, only from QL | uninstantiated |
8+
| pointer_to_member__pmIsConstT | pointer_to_member.cpp:44:22:44:26 | Unknown literal | pointer_to_member.cpp:44:21:44:26 | & ... | Standard edge, only from QL | uninstantiated |
19
| staticlocals__staticlocals_f2 | file://:0:0:0:0 | call to C | staticlocals.cpp:30:1:30:1 | return ... | Standard edge, only from QL | |
210
| staticlocals__staticlocals_f2 | file://:0:0:0:0 | initializer for c | file://:0:0:0:0 | call to C | Standard edge, only from QL | |
311
| staticlocals__staticlocals_f2 | staticlocals.cpp:29:5:29:17 | declaration | file://:0:0:0:0 | initializer for c | Standard edge, only from QL | |

0 commit comments

Comments
 (0)