New test case in TestSimplifyTokens::template_default_parameter

This commit is contained in:
Reijo Tomperi 2009-09-09 23:57:28 +03:00
parent 48846c008d
commit 908aaff1fa
1 changed files with 26 additions and 0 deletions

View File

@ -1010,6 +1010,32 @@ private:
" { int ar [ 5 ] ; }");
ASSERT_EQUALS(expected, sizeof_(code));
}
{
const char code[] = "template <class T, int n=3>\n"
"class A\n"
"{ T ar[n]; };\n"
"\n"
"void f()\n"
"{\n"
" A<int,(int)2> a1;\n"
" A<int> a2;\n"
"}\n";
// The expected result..
const std::string expected(" template < class T , int n >"
" class A"
" { T ar [ n ] ; } ;"
" void f ( )"
" {"
" A<int,(int)2> a1 ;"
" A<int,3> a2 ;"
" }"
" class A<int,2>"
" { int ar [ 2 ] ; }"
" class A<int,3>"
" { int ar [ 3 ] ; }");
TODO_ASSERT_EQUALS(expected, sizeof_(code));
}
}
void template_typename()