diff --git a/lib/token.cpp b/lib/token.cpp index de5b3b47e..2e4dff391 100644 --- a/lib/token.cpp +++ b/lib/token.cpp @@ -988,7 +988,12 @@ void Token::stringify(std::ostream& os, bool varid, bool attributes, bool macro) } if (macro && isExpandedMacro()) os << "$"; - if (_str[0] != '\"' || _str.find('\0') == std::string::npos) + if (isName() && _str.find(' ') != std::string::npos) { + for (std::size_t i = 0U; i < _str.size(); ++i) { + if (_str[i] != ' ') + os << _str[i]; + } + } else if (_str[0] != '\"' || _str.find('\0') == std::string::npos) os << _str; else { for (std::size_t i = 0U; i < _str.size(); ++i) { diff --git a/test/testsimplifytemplate.cpp b/test/testsimplifytemplate.cpp index a69f66209..d7ff36aeb 100644 --- a/test/testsimplifytemplate.cpp +++ b/test/testsimplifytemplate.cpp @@ -152,8 +152,8 @@ private: const char code[] = "template void f(T val) { T a; }\n" "f(10);"; - const char expected[] = "f < int > ( 10 ) ; " - "void f < int > ( int val ) { }"; + const char expected[] = "f ( 10 ) ; " + "void f ( int val ) { }"; ASSERT_EQUALS(expected, tok(code)); } @@ -162,8 +162,8 @@ private: const char code[] = "template class Fred { T a; };\n" "Fred fred;"; - const char expected[] = "Fred < int > fred ; " - "class Fred < int > { int a ; } ;"; + const char expected[] = "Fred fred ; " + "class Fred { int a ; } ;"; ASSERT_EQUALS(expected, tok(code)); } @@ -172,8 +172,8 @@ private: const char code[] = "template class Fred { T data[sz]; };\n" "Fred fred;"; - const char expected[] = "Fred < float , 4 > fred ; " - "class Fred < float , 4 > { float data [ 4 ] ; } ;"; + const char expected[] = "Fred fred ; " + "class Fred { float data [ 4 ] ; } ;"; ASSERT_EQUALS(expected, tok(code)); } @@ -182,8 +182,8 @@ private: const char code[] = "template class Fred { Fred(); };\n" "Fred fred;"; - const char expected[] = "Fred < float > fred ; " - "class Fred < float > { Fred < float > ( ) ; } ;"; + const char expected[] = "Fred fred ; " + "class Fred { Fred ( ) ; } ;"; ASSERT_EQUALS(expected, tok(code)); } @@ -194,9 +194,9 @@ private: "Fred fred;"; const char expected[] = "template < class T > Fred < T > :: Fred ( ) { } " // <- TODO: this should be removed - "Fred < float > fred ; " - "class Fred < float > { } ; " - "Fred < float > :: Fred ( ) { }"; + "Fred fred ; " + "class Fred { } ; " + "Fred :: Fred ( ) { }"; ASSERT_EQUALS(expected, tok(code)); } @@ -206,9 +206,9 @@ private: "Fred fred1;\n" "Fred fred2;"; - const char expected[] = "Fred < float > fred1 ; " - "Fred < float > fred2 ; " - "class Fred < float > { } ;"; + const char expected[] = "Fred fred1 ; " + "Fred fred2 ; " + "class Fred { } ;"; ASSERT_EQUALS(expected, tok(code)); } @@ -320,9 +320,9 @@ private: "} ;\n"; // The expected result.. - const char expected[] = "void f ( ) { A < int > a ; } " + const char expected[] = "void f ( ) { A a ; } " "template < typename T > class B { void g ( ) { A < T > b ; b = A < T > :: h ( ) ; } } ; " - "class A < int > { } ;"; + "class A { } ;"; ASSERT_EQUALS(expected, tok(code)); } @@ -339,9 +339,9 @@ private: // The expected result.. const char expected[] = "void f ( ) " "{" - " foo < 3 , int > ( ) ; " + " foo<3,int> ( ) ; " "} " - "int * foo < 3 , int > ( ) { return new int [ 3 ] ; }"; + "int * foo<3,int> ( ) { return new int [ 3 ] ; }"; ASSERT_EQUALS(expected, tok(code)); } @@ -357,9 +357,9 @@ private: // The expected result.. const char expected[] = "void f ( ) " "{" - " char * p ; p = foo < 3 , char > ( ) ; " + " char * p ; p = foo<3,char> ( ) ; " "} " - "char * foo < 3 , char > ( ) { return new char [ 3 ] ; }"; + "char * foo<3,char> ( ) { return new char [ 3 ] ; }"; ASSERT_EQUALS(expected, tok(code)); } @@ -376,9 +376,9 @@ private: // The expected result.. const char expected[] = "void f ( ) " "{" - " A < 12 , 12 , 11 > a ; " + " A<12,12,11> a ; " "} " - "class A < 12 , 12 , 11 > : public B < 12 , 12 , 0 > " + "class A<12,12,11> : public B < 12 , 12 , 0 > " "{ } ;"; ASSERT_EQUALS(expected, tok(code)); } @@ -422,10 +422,10 @@ private: "}\n"; // The expected result.. - const char expected[] = "void foo < int * > ( ) " + const char expected[] = "void foo ( ) " "{ x ( ) ; } " "int main ( ) " - "{ foo < int * > ( ) ; }"; + "{ foo ( ) ; }"; ASSERT_EQUALS(expected, tok(code)); } @@ -446,11 +446,11 @@ private: "}\n"; // The expected result.. - const char expected[] = "void a < 0 > ( ) { } " + const char expected[] = "void a<0> ( ) { } " "int main ( ) " - "{ a < 2 > ( ) ; return 0 ; } " - "void a < 2 > ( ) { a < 1 > ( ) ; } " - "void a < 1 > ( ) { a < 0 > ( ) ; }"; + "{ a<2> ( ) ; return 0 ; } " + "void a<2> ( ) { a<1> ( ) ; } " + "void a<1> ( ) { a<0> ( ) ; }"; ASSERT_EQUALS(expected, tok(code)); @@ -461,10 +461,10 @@ private: "};\n" "\n" "vec<4> v;"; - const char expected2[] = "vec < 4 > v ; " - "struct vec < 4 > { " - "vec < 4 > ( ) { } " - "vec < 4 > ( const vec < 4 - 1 > & v ) { } " + const char expected2[] = "vec<4> v ; " + "struct vec<4> { " + "vec<4> ( ) { } " + "vec<4> ( const vec < 4 - 1 > & v ) { } " "} ;"; ASSERT_EQUALS(expected2, tok(code2)); @@ -483,9 +483,9 @@ private: " return 0;\n" "}\n"; - const char expected[] = "int main ( ) { b < 2 > ( ) ; return 0 ; } " - "void b < 2 > ( ) { a < 2 > ( ) ; } " - "void a < 2 > ( ) { }"; + const char expected[] = "int main ( ) { b<2> ( ) ; return 0 ; } " + "void b<2> ( ) { a<2> ( ) ; } " + "void a<2> ( ) { }"; ASSERT_EQUALS(expected, tok(code)); } @@ -510,8 +510,8 @@ private: const char code[] = "template class foo { T a; };\n" "foo *f;"; - const char expected[] = "foo < int > * f ; " - "class foo < int > { int a ; } ;"; + const char expected[] = "foo * f ; " + "class foo { int a ; } ;"; ASSERT_EQUALS(expected, tok(code)); } @@ -528,9 +528,9 @@ private: // The expected result.. const char expected[] = "void f ( ) " "{" - " char p ; p = foo < char > ( ) ; " + " char p ; p = foo ( ) ; " "} " - "char & foo < char > ( ) { static char temp ; return temp ; }"; + "char & foo ( ) { static char temp ; return temp ; }"; ASSERT_EQUALS(expected, tok(code)); } @@ -550,9 +550,9 @@ private: // The expected result.. const char expected[] = "template < class T > A < T > :: ~ A ( ) { } " // <- TODO: this should be removed - "A < int > a ; " - "class A < int > { public: ~ A < int > ( ) ; } ; " - "A < int > :: ~ A < int > ( ) { }"; + "A a ; " + "class A { public: ~ A ( ) ; } ; " + "A :: ~ A ( ) { }"; ASSERT_EQUALS(expected, tok(code)); } @@ -561,8 +561,8 @@ private: const char code[] = "template struct Fred { T a; };\n" "Fred fred;"; - const char expected[] = "Fred < int > fred ; " - "struct Fred < int > { int a ; } ;"; + const char expected[] = "Fred fred ; " + "struct Fred { int a ; } ;"; ASSERT_EQUALS(expected, tok(code)); } @@ -571,8 +571,8 @@ private: const char code[] = "template struct Fred { T data[sz]; };\n" "Fred fred;"; - const char expected[] = "Fred < float , 4 > fred ; " - "struct Fred < float , 4 > { float data [ 4 ] ; } ;"; + const char expected[] = "Fred fred ; " + "struct Fred { float data [ 4 ] ; } ;"; ASSERT_EQUALS(expected, tok(code)); } @@ -581,8 +581,8 @@ private: const char code[] = "template struct Fred { Fred(); };\n" "Fred fred;"; - const char expected[] = "Fred < float > fred ; " - "struct Fred < float > { Fred < float > ( ) ; } ;"; + const char expected[] = "Fred fred ; " + "struct Fred { Fred ( ) ; } ;"; ASSERT_EQUALS(expected, tok(code)); } @@ -592,9 +592,9 @@ private: "Fred fred1;\n" "Fred fred2;"; - const char expected[] = "Fred < float > fred1 ; " - "Fred < float > fred2 ; " - "struct Fred < float > { } ;"; + const char expected[] = "Fred fred1 ; " + "Fred fred2 ; " + "struct Fred { } ;"; ASSERT_EQUALS(expected, tok(code)); } @@ -604,8 +604,8 @@ private: const char code[] = "template struct Fred { T a; };\n" "Fred fred;"; - const char expected[] = "Fred < std :: string > fred ; " - "struct Fred < std :: string > { std :: string a ; } ;"; + const char expected[] = "Fred fred ; " + "struct Fred { std :: string a ; } ;"; ASSERT_EQUALS(expected, tok(code)); } @@ -617,9 +617,9 @@ private: "}"; const char expected[] = "void bar ( ) {" - " std :: cout << ( foo < double > ( ) ) ; " + " std :: cout << ( foo ( ) ) ; " "} " - "void foo < double > ( ) { }"; + "void foo ( ) { }"; ASSERT_EQUALS(expected, tok(code)); } @@ -635,9 +635,9 @@ private: "{};\n" "\n" "bitset<1> z;"; - const char expected[] = "bitset < 1 > z ; " - "class bitset < 1 > : B < 4 > { } ; " - "struct B < 4 > { int a [ 4 ] ; } ;"; + const char expected[] = "bitset<1> z ; " + "class bitset<1> : B<4> { } ; " + "struct B<4> { int a [ 4 ] ; } ;"; ASSERT_EQUALS(expected, tok(code)); } @@ -653,11 +653,11 @@ private: "bitset<1> z;"; const char actual[] = "template < int n > struct B { int a [ n ] ; } ; " - "bitset < 1 > z ; " - "class bitset < 1 > : B < 4 > { } ;"; + "bitset<1> z ; " + "class bitset<1> : B < 4 > { } ;"; - const char expected[] = "bitset < 1 > z ; " - "class bitset < 1 > : B < 4 > { } ; " + const char expected[] = "bitset<1> z ; " + "class bitset<1> : B < 4 > { } ; " "struct B < 4 > { int a [ 4 ] ; } ;"; TODO_ASSERT_EQUALS(expected, actual, tok(code)); @@ -674,7 +674,7 @@ private: "\n" "C<2> a;\n"; // TODO: expand A also - ASSERT_EQUALS("template < class T > class A { public: T x ; } ; C < 2 > a ; class C < 2 > : public A < char [ 2 ] > { } ;", tok(code)); + ASSERT_EQUALS("template < class T > class A { public: T x ; } ; C<2> a ; class C<2> : public A < char [ 2 ] > { } ;", tok(code)); } void template27() { @@ -687,7 +687,7 @@ private: // #3226 - inner template const char code[] = "template class Fred {};\n" "Fred > x;\n"; - ASSERT_EQUALS("Fred < int , Fred < int , int > > x ; class Fred < int , int > { } ; class Fred < int , Fred < int , int > > { } ;", tok(code)); + ASSERT_EQUALS("Fred < int , Fred > x ; class Fred { } ; class Fred> { } ;", tok(code)); } void template30() { @@ -699,11 +699,11 @@ private: void template31() { // #4010 - template reference type const char code[] = "template struct A{}; A a;"; - ASSERT_EQUALS("A < int & > a ; struct A < int & > { } ;", tok(code)); + ASSERT_EQUALS("A a ; struct A { } ;", tok(code)); // #7409 - rvalue const char code2[] = "template struct A{}; A a;"; - ASSERT_EQUALS("A < int && > a ; struct A < int && > { } ;", tok(code2)); + ASSERT_EQUALS("A a ; struct A { } ;", tok(code2)); } void template32() { @@ -719,8 +719,8 @@ private: "\n" "B b;\n"; ASSERT_EQUALS("template < class T1 , class T2 , class T3 , class T4 > struct A { } ; " - "B < int > b ; " - "struct B < int > { public: A < int , Pair < int , int > , int > a ; } ;", tok(code)); + "B b ; " + "struct B { public: A < int , Pair < int , int > , int > a ; } ;", tok(code)); } void template33() { @@ -730,10 +730,10 @@ private: "template struct B { };\n" "template struct C { A > > ab; };\n" "C c;"; - ASSERT_EQUALS("C < int > c ; " - "struct C < int > { A < B < X < int > > > ab ; } ; " - "struct B < X < int > > { } ; " // <- redundant.. but nevermind - "struct A < B < X < int > > > { } ;", tok(code)); + ASSERT_EQUALS("C c ; " + "struct C { A < B> > ab ; } ; " + "struct B> { } ; " // <- redundant.. but nevermind + "struct A>> { } ;", tok(code)); } { @@ -744,7 +744,7 @@ private: "C< B > c;"; ASSERT_EQUALS("struct A { } ; " "template < class T > struct B { } ; " // <- redundant.. but nevermind - "C < B < A > > c ; struct C < B < A > > { } ;", + "C> c ; struct C> { } ;", tok(code)); } } @@ -764,16 +764,16 @@ private: void template35() { // #4074 - "A<'x'> a;" is not recognized as template instantiation const char code[] = "template class A {};\n" "A <'x'> a;"; - ASSERT_EQUALS("A < 'x' > a ; class A < 'x' > { } ;", tok(code)); + ASSERT_EQUALS("A<'x'> a ; class A<'x'> { } ;", tok(code)); } void template36() { // #4310 - Passing unknown template instantiation as template argument const char code[] = "template struct X { T t; };\n" "template struct Y { Foo < X< Bar > > _foo; };\n" // <- Bar is unknown "Y bar;"; - ASSERT_EQUALS("Y < int > bar ; " - "struct Y < int > { Foo < X < Bar < int > > > _foo ; } ; " - "struct X < Bar < int > > { Bar < int > t ; } ;", + ASSERT_EQUALS("Y bar ; " + "struct Y { Foo < X> > _foo ; } ; " + "struct X> { Bar < int > t ; } ;", tok(code)); } @@ -783,7 +783,7 @@ private: "template class B {};\n" "B b1;\n" "B b2;"; - ASSERT_EQUALS("class A { } ; B < A > b1 ; B < A > b2 ; class B < A > { } ;", + ASSERT_EQUALS("class A { } ; B b1 ; B b2 ; class B { } ;", tok(code)); } { @@ -791,7 +791,7 @@ private: "template class B {};\n" "B b1;\n" "B b2;"; - ASSERT_EQUALS("struct A { } ; B < A > b1 ; B < A > b2 ; class B < A > { } ;", + ASSERT_EQUALS("struct A { } ; B b1 ; B b2 ; class B { } ;", tok(code)); } { @@ -799,7 +799,7 @@ private: "template class B {};\n" "B b1;\n" "B b2;"; - ASSERT_EQUALS("enum A { } ; B < A > b1 ; B < A > b2 ; class B < A > { } ;", + ASSERT_EQUALS("enum A { } ; B b1 ; B b2 ; class B { } ;", tok(code)); } } @@ -845,11 +845,11 @@ private: void template41() { // #4710 - const in template instantiation not handled perfectly const char code1[] = "template struct X { };\n" "void f(const X x) { }"; - ASSERT_EQUALS("void f ( const X < int > x ) { } struct X < int > { } ;", tok(code1)); + ASSERT_EQUALS("void f ( const X x ) { } struct X { } ;", tok(code1)); const char code2[] = "template T f(T t) { return t; }\n" "int x() { return f(123); }"; - ASSERT_EQUALS("int x ( ) { return f < int > ( 123 ) ; } int f < int > ( int t ) { return t ; }", tok(code2)); + ASSERT_EQUALS("int x ( ) { return f ( 123 ) ; } int f ( int t ) { return t ; }", tok(code2)); } void template42() { // #4878 cpcheck aborts in ext-blocks.cpp (clang testcode) @@ -938,14 +938,14 @@ private: const char expected[] = "template < class T > void Fred < T > :: f ( ) { } " "template < class T > void Fred < T > :: g ( ) { } " - "template void Fred < float > :: f ( ) ; " - "template void Fred < int > :: g ( ) ; " - "class Fred < float > { void f ( ) ; void g ( ) ; } ; " - "Fred < float > :: f ( ) { } " - "Fred < float > :: g ( ) { } " - "class Fred < int > { void f ( ) ; void g ( ) ; } ; " - "Fred < int > :: f ( ) { } " - "Fred < int > :: g ( ) { }"; + "template void Fred :: f ( ) ; " + "template void Fred :: g ( ) ; " + "class Fred { void f ( ) ; void g ( ) ; } ; " + "Fred :: f ( ) { } " + "Fred :: g ( ) { } " + "class Fred { void f ( ) ; void g ( ) ; } ; " + "Fred :: f ( ) { } " + "Fred :: g ( ) { }"; ASSERT_EQUALS(expected, tok(code)); } @@ -1020,11 +1020,11 @@ private: // Similar problem can also happen with ... ASSERT_EQUALS( - "A < int > a ( 0 ) ; struct A < int > { " - "A < int > ( int * p ) { p ; } " + "A a ( 0 ) ; struct A { " + "A ( int * p ) { p ; } " "} ; " - "struct A < int . . . > { " - "A < int . . . > ( int * p ) { " + "struct A { " + "A ( int * p ) { " "p ; " "} } ;", tok("template struct A\n" @@ -1049,8 +1049,8 @@ private: void template57() { // #7891 const char code[] = "template struct Test { Test(T); };\n" "Test test( 0 );"; - const char exp [] = "Test < unsigned long > test ( 0 ) ; " - "struct Test < unsigned long > { Test < unsigned long > ( long ) ; } ;"; + const char exp [] = "Test test ( 0 ) ; " + "struct Test { Test ( long ) ; } ;"; ASSERT_EQUALS(exp, tok(code)); } @@ -1063,9 +1063,9 @@ private: " TestArithmetic();\n" "}"; const char exp[] = "void foo ( ) {" - " TestArithmetic < int > ( ) ; " + " TestArithmetic ( ) ; " "} " - "void TestArithmetic < int > ( ) {" + "void TestArithmetic ( ) {" " x ( CheckedNumeric < int > ( ) ) ; " "}"; ASSERT_EQUALS(exp, tok(code)); @@ -1087,13 +1087,13 @@ private: "int main () {\n" " return diagonalGroupTest<4>();\n" "}"; - const char exp[] = "struct Factorial < 0 > { enum FacHelper { value = 1 } ; } ; " - "int main ( ) { return diagonalGroupTest < 4 > ( ) ; } " - "int diagonalGroupTest < 4 > ( ) { return Factorial < 4 > :: value ; } " - "struct Factorial < 4 > { enum FacHelper { value = 4 * Factorial < 3 > :: value } ; } ; " - "struct Factorial < 3 > { enum FacHelper { value = 3 * Factorial < 2 > :: value } ; } ; " - "struct Factorial < 2 > { enum FacHelper { value = 2 * Factorial < 1 > :: value } ; } ; " - "struct Factorial < 1 > { enum FacHelper { value = Factorial < 0 > :: value } ; } ;"; + const char exp[] = "struct Factorial<0> { enum FacHelper { value = 1 } ; } ; " + "int main ( ) { return diagonalGroupTest<4> ( ) ; } " + "int diagonalGroupTest<4> ( ) { return Factorial<4> :: value ; } " + "struct Factorial<4> { enum FacHelper { value = 4 * Factorial<3> :: value } ; } ; " + "struct Factorial<3> { enum FacHelper { value = 3 * Factorial<2> :: value } ; } ; " + "struct Factorial<2> { enum FacHelper { value = 2 * Factorial<1> :: value } ; } ; " + "struct Factorial<1> { enum FacHelper { value = Factorial < 0 > :: value } ; } ;"; ASSERT_EQUALS(exp, tok(code)); } @@ -1104,9 +1104,9 @@ private: "\n" "void j() { h(); }"; const char exp[] = "template < typename T > void f ( ) { } " // <- TODO: This template is not expanded - "void j ( ) { h < int > ( ) ; } " - "void h < int > ( ) { f < S < int > :: type ( 0 ) > ( ) ; } " - "struct S < int > { } ;"; + "void j ( ) { h ( ) ; } " + "void h ( ) { f < S :: type ( 0 ) > ( ) ; } " + "struct S { } ;"; ASSERT_EQUALS(exp, tok(code)); } @@ -1165,12 +1165,12 @@ private: // The expected result.. const char expected[] = "void f ( ) " "{" - " A < int , 2 > a1 ;" - " A < int , 3 > a2 ; " + " A a1 ;" + " A a2 ; " "} " - "class A < int , 2 > " + "class A " "{ int ar [ 2 ] ; } ; " - "class A < int , 3 > " + "class A " "{ int ar [ 3 ] ; } ;"; ASSERT_EQUALS(expected, tok(code)); } @@ -1188,10 +1188,10 @@ private: // The expected result.. const char expected[] = "void f ( ) " "{" - " A < int , 3 , 2 > a1 ;" - " A < int , 3 , 2 > a2 ; " + " A a1 ;" + " A a2 ; " "} " - "class A < int , 3 , 2 > " + "class A " "{ int ar [ 5 ] ; } ;"; ASSERT_EQUALS(expected, tok(code)); } @@ -1222,9 +1222,9 @@ private: const char current[] = "void f ( ) " "{ " "A < int , ( int ) 2 > a1 ; " - "A < int , 3 > a2 ; " + "A a2 ; " "} " - "class A < int , 3 > " + "class A " "{ int ar [ 3 ] ; } ;"; TODO_ASSERT_EQUALS(wanted, current, tok(code)); } @@ -1247,8 +1247,8 @@ private: "thv_table_c> id_table_m ; " "class thv_table_c> { } ;"; const char curr[] = "template < class T , class U > class DefaultMemory { } ; " - "thv_table_c < void * , void * , DefaultMemory < Key , Val > > id_table_m ; " - "class thv_table_c < void * , void * , DefaultMemory < Key , Val > > { } ;"; + "thv_table_c> id_table_m ; " + "class thv_table_c> { } ;"; TODO_ASSERT_EQUALS(exp, curr, tok(code)); } } @@ -1399,8 +1399,8 @@ private: "}\n" "Fred(123);"; ASSERT_EQUALS("namespace { } " - "Fred < int > ( 123 ) ; " - "void Fred < int > ( int value ) { }", tok(code)); + "Fred ( 123 ) ; " + "void Fred ( int value ) { }", tok(code)); } unsigned int templateParameters(const char code[]) { @@ -1487,8 +1487,8 @@ private: } void expandSpecialized() { - ASSERT_EQUALS("class A < int > { } ;", tok("template<> class A {};")); - ASSERT_EQUALS("class A < int > : public B { } ;", tok("template<> class A : public B {};")); + ASSERT_EQUALS("class A { } ;", tok("template<> class A {};")); + ASSERT_EQUALS("class A : public B { } ;", tok("template<> class A : public B {};")); } unsigned int instantiateMatch(const char code[], const std::string& name, const std::size_t numberOfArguments, const char patternAfter[]) { diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 8ea6ea229..3c1dbd244 100755 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -830,11 +830,11 @@ private: "template Containter::Containter() : mElements(nullptr) {}\n" "Containter intContainer;"; const char exp [] = "5: template < class T > Containter < T > :: Containter ( ) : mElements ( nullptr ) { }\n" - "6: Containter < int > intContainer@1 ; struct Containter < int > {\n" - "2: Containter < int > ( ) ;\n" + "6: Containter intContainer@1 ; struct Containter {\n" + "2: Containter ( ) ;\n" "3: int * mElements@2 ;\n" "4: } ;\n" - "5: Containter < int > :: Containter ( ) : mElements@2 ( nullptr ) { }\n"; + "5: Containter :: Containter ( ) : mElements@2 ( nullptr ) { }\n"; ASSERT_EQUALS(exp, tokenizeDebugListing(code, /*simplify=*/true)); } } @@ -4965,7 +4965,7 @@ private: "{\n" " fn2();\n" "}\n"; - ASSERT_EQUALS("int main ( )\n{\nfn2 < int > ( ) ;\n} void fn2 < int > ( int t = [ ] { return 1 ; } ( ) )\n{ }", tokenizeAndStringify(code)); + ASSERT_EQUALS("int main ( )\n{\nfn2 ( ) ;\n} void fn2 ( int t = [ ] { return 1 ; } ( ) )\n{ }", tokenizeAndStringify(code)); } void cpp0xtemplate2() {