From 373a21aa3fe0a144d4bd917864b7455127ff1c1d Mon Sep 17 00:00:00 2001 From: Seth R Johnson Date: Wed, 6 Feb 2019 08:41:10 -0500 Subject: [PATCH] Fix failure of %apply directive in anonymous templates --- Examples/test-suite/typemap_template.i | 2 +- Source/CParse/parser.y | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Examples/test-suite/typemap_template.i b/Examples/test-suite/typemap_template.i index 221f821d2..9f283105b 100644 --- a/Examples/test-suite/typemap_template.i +++ b/Examples/test-suite/typemap_template.i @@ -59,6 +59,6 @@ template struct Foo {}; void this_works(Foo f) {} void this_also_works(const Foo& f) {} void this_also_also_works(Foo f) {} - void this_fails(const Foo& f) {} + void this_used_to_fail(const Foo& f) {} %} diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y index ee121abec..29e5705bf 100644 --- a/Source/CParse/parser.y +++ b/Source/CParse/parser.y @@ -2962,7 +2962,7 @@ template_directive: SWIGTEMPLATE LPAREN idstringopt RPAREN idcolonnt LESSTHAN va Swig_cparse_template_expand(templnode,nname,temparms,tscope); Setattr(templnode,"sym:name",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) { 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"); }