Skip to content

Commit e0d1da3

Browse files
committed
C++: Test for template enum constant CFG
1 parent 7d8396f commit e0d1da3

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,16 @@ void f2() {
2929
static C c{};
3030
}
3131

32+
template<typename T>
33+
struct Sizeof {
34+
enum sizeof_enum { value = sizeof(T) };
35+
};
36+
37+
template<typename T>
38+
void f3() {
39+
static int i = Sizeof<T>::value;
40+
}
41+
42+
template void f3<int>();
43+
3244
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
| staticlocals__staticlocals_f2 | file://:0:0:0:0 | call to C | staticlocals.cpp:30:1:30:1 | return ... | Standard edge, only from QL | |
22
| staticlocals__staticlocals_f2 | file://:0:0:0:0 | initializer for c | file://:0:0:0:0 | call to C | Standard edge, only from QL | |
33
| staticlocals__staticlocals_f2 | staticlocals.cpp:29:5:29:17 | declaration | file://:0:0:0:0 | initializer for c | Standard edge, only from QL | |
4+
| staticlocals__staticlocals_f3 | staticlocals.cpp:39:3:39:34 | declaration | staticlocals.cpp:39:18:39:33 | initializer for i | Standard edge, only from QL | uninstantiated |
5+
| staticlocals__staticlocals_f3 | staticlocals.cpp:39:18:39:33 | Unknown literal | staticlocals.cpp:40:1:40:1 | return ... | Standard edge, only from QL | uninstantiated |
6+
| staticlocals__staticlocals_f3 | staticlocals.cpp:39:18:39:33 | initializer for i | staticlocals.cpp:39:18:39:33 | Unknown literal | Standard edge, only from QL | uninstantiated |

0 commit comments

Comments
 (0)