From d0d3ce50c9f9a5901ff3ca0ae0fb199874a78db6 Mon Sep 17 00:00:00 2001 From: Simon Martin Date: Sat, 6 Jul 2013 13:12:39 +0200 Subject: [PATCH] Added testcase for (now working) ticket #4742. --- test/testsimplifytokens.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/testsimplifytokens.cpp b/test/testsimplifytokens.cpp index 189a88113..6ed5ffb72 100644 --- a/test/testsimplifytokens.cpp +++ b/test/testsimplifytokens.cpp @@ -131,6 +131,7 @@ private: TEST_CASE(template36); // #4310 - passing unknown template instantiation as template argument TEST_CASE(template37); // #4544 - A a; TEST_CASE(template38); // #4832 - crash on C++11 right angle brackets + TEST_CASE(template39); // #4742 - freeze TEST_CASE(template_unhandled); TEST_CASE(template_default_parameter); TEST_CASE(template_default_type); @@ -2308,6 +2309,17 @@ private: tok(code); // Don't crash or freeze } + void template39() { // #4742 - Used to freeze in 1.60 + const char code[] = "template struct vector {" + " operator T() const;" + "};" + "void f() {" + " vector> v;" + " const vector vi = static_cast>(v);" + "}"; + tok(code); + } + void template_default_parameter() { { const char code[] = "template \n"