C++: Enhance a test

This commit is contained in:
Ian Lynagh
2018-05-26 01:17:22 +01:00
parent d976168b59
commit 1b7961367a
2 changed files with 28 additions and 1 deletions

View File

@@ -48,3 +48,26 @@ void templateFunctionUser(signed int x, unsigned int y) {
twiceUsedTemplateFunction(y);
}
class C {
public:
int ff() {
int i;
gg(i);
}
// Although there is a declaration of gg starting here,
// the number of lines count shouldn't.
template<typename T>
void gg(T t);
};
template<typename T>
void C::gg(T t) {
;
}
void hh() {
C n;
n.ff();
}

View File

@@ -1,8 +1,12 @@
| C::ff() | 4 | 4 | 0 |
| C::gg<T>(T) | 4 | 4 | 0 |
| C::gg<T>(T) | 10 | 7 | 0 |
| conventional() | 4 | 4 | 1 |
| hh() | 4 | 4 | 0 |
| long_char() | 3 | 3 | 0 |
| long_string() | 5 | 5 | 0 |
| misleading_comment() | 7 | 2 | 5 |
| numlines | 50 | 37 | 6 |
| numlines | 73 | 54 | 8 |
| onceUsedTemplateFunction<T>(T) | 6 | 6 | 0 |
| templateFunctionUser(signed int,unsigned int) | 5 | 5 | 0 |
| twiceUsedTemplateFunction<T>(T) | 6 | 6 | 0 |