diff --git a/test/testsimplifytokens.cpp b/test/testsimplifytokens.cpp index dc362324a..3ca573a2d 100644 --- a/test/testsimplifytokens.cpp +++ b/test/testsimplifytokens.cpp @@ -78,6 +78,7 @@ private: TEST_CASE(template10); TEST_CASE(template11); TEST_CASE(template12); + TEST_CASE(template_default_parameter); TEST_CASE(namespaces); @@ -915,7 +916,33 @@ private: ASSERT_EQUALS(expected, sizeof_(code)); } + void template_default_parameter() + { + const char code[] = "template \n" + "class A\n" + "{ T ar[n]; };\n" + "\n" + "void f()\n" + "{\n" + " A a1;\n" + " A a2;\n" + "}\n"; + // The expected result.. + const std::string expected(" template < class T , int n = 3 >" + " class A" + " { T ar [ n ] ; } ;" + " void f ( )" + " {" + " A a1 ;" + " A a2 ;" + " }" + " class A" + " { int ar[2]; }" + " class A" + " { int ar[3]; }"); + TODO_ASSERT_EQUALS(expected, sizeof_(code)); + } void namespaces()