Fix failure of %apply directive in anonymous templates

This commit is contained in:
Seth R Johnson 2019-02-06 08:41:10 -05:00
parent 4824b56e59
commit 373a21aa3f
2 changed files with 2 additions and 2 deletions

View File

@ -59,6 +59,6 @@ template<class T> struct Foo {};
void this_works(Foo<int> f) {} void this_works(Foo<int> f) {}
void this_also_works(const Foo<int>& f) {} void this_also_works(const Foo<int>& f) {}
void this_also_also_works(Foo<double> f) {} void this_also_also_works(Foo<double> f) {}
void this_fails(const Foo<double>& f) {} void this_used_to_fail(const Foo<double>& f) {}
%} %}

View File

@ -2962,7 +2962,7 @@ template_directive: SWIGTEMPLATE LPAREN idstringopt RPAREN idcolonnt LESSTHAN va
Swig_cparse_template_expand(templnode,nname,temparms,tscope); Swig_cparse_template_expand(templnode,nname,temparms,tscope);
Setattr(templnode,"sym:name",nname); Setattr(templnode,"sym:name",nname);
Delete(nname); Delete(nname);
Setattr(templnode,"feature:onlychildren", "typemap,typemapitem,typemapcopy,typedef,types,fragment"); Setattr(templnode,"feature:onlychildren", "typemap,typemapitem,typemapcopy,typedef,types,fragment,apply");
if ($3) { if ($3) {
Swig_warning(WARN_PARSE_NESTED_TEMPLATE, cparse_file, cparse_line, "Named nested template instantiations not supported. Processing as if no name was given to %%template().\n"); Swig_warning(WARN_PARSE_NESTED_TEMPLATE, cparse_file, cparse_line, "Named nested template instantiations not supported. Processing as if no name was given to %%template().\n");
} }