Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1b79613

Browse files
committed
C++: Enhance a test
1 parent d976168 commit 1b79613

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

cpp/ql/test/library-tests/numlines/numlines.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,26 @@ void templateFunctionUser(signed int x, unsigned int y) {
4848
twiceUsedTemplateFunction(y);
4949
}
5050

51+
class C {
52+
public:
53+
int ff() {
54+
int i;
55+
gg(i);
56+
}
57+
// Although there is a declaration of gg starting here,
58+
// the number of lines count shouldn't.
59+
template<typename T>
60+
void gg(T t);
61+
};
62+
63+
64+
65+
template<typename T>
66+
void C::gg(T t) {
67+
;
68+
}
69+
void hh() {
70+
C n;
71+
n.ff();
72+
}
73+
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
| C::ff() | 4 | 4 | 0 |
2+
| C::gg<T>(T) | 4 | 4 | 0 |
3+
| C::gg<T>(T) | 10 | 7 | 0 |
14
| conventional() | 4 | 4 | 1 |
5+
| hh() | 4 | 4 | 0 |
26
| long_char() | 3 | 3 | 0 |
37
| long_string() | 5 | 5 | 0 |
48
| misleading_comment() | 7 | 2 | 5 |
5-
| numlines | 50 | 37 | 6 |
9+
| numlines | 73 | 54 | 8 |
610
| onceUsedTemplateFunction<T>(T) | 6 | 6 | 0 |
711
| templateFunctionUser(signed int,unsigned int) | 5 | 5 | 0 |
812
| twiceUsedTemplateFunction<T>(T) | 6 | 6 | 0 |

0 commit comments

Comments
 (0)