Skip to content

Commit a4375ef

Browse files
Update testtokenize.cpp
1 parent 826ebd9 commit a4375ef

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

test/testtokenize.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2387,6 +2387,19 @@ class TestTokenizer : public TestFixture {
23872387
ASSERT_EQUALS(expected, tokenizeAndStringify(code));
23882388
}
23892389

2390+
void vardecl_template_3() {
2391+
const char code[] = "template <class T>\n" // #14909
2392+
"void f(T x) {\n"
2393+
" const auto y = h<T, x.size()>;\n"
2394+
"}";
2395+
const char expected[] = "template < class T >\n"
2396+
"void f ( T x ) {\n"
2397+
"const auto y = h < T , x . size ( ) > ;\n"
2398+
"}";
2399+
ASSERT_EQUALS(expected, tokenizeAndStringify(code));
2400+
ASSERT_EQUALS("[test.cpp:3:11]: (debug) auto token with no type. [autoNoType]\n", errout_str());
2401+
}
2402+
23902403
void vardecl_union() {
23912404
// ticket #1976
23922405
const char code1[] = "class Fred { public: union { int a ; int b ; } ; } ;";

0 commit comments

Comments
 (0)