C++11 alias templates seg fault fix
Segfault fix when using alias templates, reported by Pierre-Henri Wuillemin
This commit is contained in:
parent
6624f66af5
commit
b175df4e5f
2 changed files with 11 additions and 3 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
%module cpp11_template_typedefs
|
%module cpp11_template_typedefs
|
||||||
|
|
||||||
%warnfilter(SWIGWARN_CPP11_ALIAS_TEMPLATE) TypedefName;
|
%warnfilter(SWIGWARN_CPP11_ALIAS_TEMPLATE) TypedefName;
|
||||||
|
%warnfilter(SWIGWARN_CPP11_ALIAS_TEMPLATE) MyIntKeyClass;
|
||||||
%warnfilter(SWIGWARN_CPP11_ALIAS_DECLARATION) PF;
|
%warnfilter(SWIGWARN_CPP11_ALIAS_DECLARATION) PF;
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
|
|
@ -19,5 +20,13 @@ using TypedefName = SomeType<char*, T2, 5>;
|
||||||
// type aliasing
|
// type aliasing
|
||||||
typedef void (*PFD)(double); // Old style
|
typedef void (*PFD)(double); // Old style
|
||||||
using PF = void (*)(double); // New introduced syntax
|
using PF = void (*)(double); // New introduced syntax
|
||||||
|
|
||||||
|
|
||||||
|
// use of template aliasing
|
||||||
|
template<typename Key,typename Val>
|
||||||
|
class MyCPP11Class {
|
||||||
|
};
|
||||||
|
template<typename VAL> using MyIntKeyClass = MyCPP11Class<int,VAL>;
|
||||||
|
MyIntKeyClass<char> intchar;
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3208,16 +3208,15 @@ c_declaration : c_decl {
|
||||||
|
|
||||||
$$ = 0; /* TODO - ignored for now */
|
$$ = 0; /* TODO - ignored for now */
|
||||||
}
|
}
|
||||||
| TEMPLATE LESSTHAN template_parms GREATERTHAN USING idcolon EQUAL {
|
| TEMPLATE LESSTHAN template_parms GREATERTHAN USING idcolon EQUAL ID {
|
||||||
skip_decl();
|
skip_decl();
|
||||||
$$ = new_node("using");
|
$$ = new_node("using");
|
||||||
|
Setattr($$,"uname",$8);
|
||||||
Setattr($$,"name",$6);
|
Setattr($$,"name",$6);
|
||||||
add_symbols($$);
|
add_symbols($$);
|
||||||
SWIG_WARN_NODE_BEGIN($$);
|
SWIG_WARN_NODE_BEGIN($$);
|
||||||
Swig_warning(WARN_CPP11_ALIAS_TEMPLATE, cparse_file, cparse_line, "The 'using' keyword in template aliasing is not fully supported yet.\n");
|
Swig_warning(WARN_CPP11_ALIAS_TEMPLATE, cparse_file, cparse_line, "The 'using' keyword in template aliasing is not fully supported yet.\n");
|
||||||
SWIG_WARN_NODE_END($$);
|
SWIG_WARN_NODE_END($$);
|
||||||
|
|
||||||
$$ = 0; /* TODO - ignored for now */
|
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue