We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 193e013 commit 7cf550aCopy full SHA for 7cf550a
cpp/ql/test/library-tests/templates/switch/test.cpp
@@ -0,0 +1,23 @@
1
+
2
+// A regression test for a bug extracting the enum constants in a template
3
+// class.
4
5
+template <class>
6
+class C {
7
+ enum { foo, bar, baz } delim;
8
+ void f();
9
+};
10
11
+template <class T>
12
+void C<T>::f() {
13
+ switch (delim) {
14
+ case bar:
15
+ break;
16
+ case baz:
17
18
+ case foo:
19
20
+ }
21
+}
22
23
+template class C<int>;
cpp/ql/test/library-tests/templates/switch/test.expected
@@ -0,0 +1,2 @@
+| test.cpp:13:3:20:3 | switch (...) ... | 3 |
cpp/ql/test/library-tests/templates/switch/test.ql
@@ -0,0 +1,4 @@
+import cpp
+from SwitchStmt ss
+select ss, count(SwitchCase sc | ss = sc.getSwitchStmt())
0 commit comments