Added testcase for (now working) ticket #4742.

This commit is contained in:
Simon Martin 2013-07-06 13:12:39 +02:00
parent 2ef0a40aec
commit d0d3ce50c9
1 changed files with 12 additions and 0 deletions

View File

@ -131,6 +131,7 @@ private:
TEST_CASE(template36); // #4310 - passing unknown template instantiation as template argument
TEST_CASE(template37); // #4544 - A<class B> 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<typename T> struct vector {"
" operator T() const;"
"};"
"void f() {"
" vector<vector<int>> v;"
" const vector<int> vi = static_cast<vector<int>>(v);"
"}";
tok(code);
}
void template_default_parameter() {
{
const char code[] = "template <class T, int n=3>\n"