don't check number of arguments for partial template specialisation

git-svn-id: svn+ssh://svn.cprover.org/srv/svn/cbmc/trunk@4535 6afb6bc1-c8e4-404c-8f48-9ae832c5b171
This commit is contained in:
kroening 2014-08-26 07:39:30 +00:00
parent ce9b8c459c
commit 21e7b5bcf6
4 changed files with 5 additions and 13 deletions

View File

@ -14,3 +14,6 @@ template<>
struct p<long double>
{ typedef long double type; };
int main()
{
}

View File

@ -1,8 +1,7 @@
KNOWNBUG
CORE
main.cpp
^EXIT=0$
^SIGNAL=0$
--
^warning: ignoring

View File

@ -5,4 +5,3 @@ main.ii
^SIGNAL=0$
--
^warning: ignoring

View File

@ -698,19 +698,10 @@ void cpp_typecheckt::convert_class_template_specialization(
#endif
{
// partial -- we typecheck
// partial specialization -- we typecheck
declaration.partial_specialization_args()=template_args_non_tc;
declaration.set_specialization_of(template_symbol.name);
// We can't typecheck arguments yet, they are used
// for guessing later. But we can check the number.
if(template_args_non_tc.arguments().size()!=
to_cpp_declaration(template_symbol.type).template_type().template_parameters().size())
{
err_location(cpp_name.location());
throw "template specialization with wrong number of arguments";
}
typecheck_class_template(declaration);
}
}