зеркало из https://github.com/github/codeql.git
C++: regression test for extractor bug with enum in template class
This commit is contained in:
Родитель
193e013196
Коммит
7cf550a70f
|
@ -0,0 +1,23 @@
|
|||
|
||||
// A regression test for a bug extracting the enum constants in a template
|
||||
// class.
|
||||
|
||||
template <class>
|
||||
class C {
|
||||
enum { foo, bar, baz } delim;
|
||||
void f();
|
||||
};
|
||||
|
||||
template <class T>
|
||||
void C<T>::f() {
|
||||
switch (delim) {
|
||||
case bar:
|
||||
break;
|
||||
case baz:
|
||||
break;
|
||||
case foo:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
template class C<int>;
|
|
@ -0,0 +1,2 @@
|
|||
| test.cpp:13:3:20:3 | switch (...) ... | 3 |
|
||||
| test.cpp:13:3:20:3 | switch (...) ... | 3 |
|
|
@ -0,0 +1,4 @@
|
|||
import cpp
|
||||
|
||||
from SwitchStmt ss
|
||||
select ss, count(SwitchCase sc | ss = sc.getSwitchStmt())
|
Загрузка…
Ссылка в новой задаче