Merge branch 'liorgold-alias-template'
* liorgold-alias-template: Warning header cosmetics Fix decl attribute in C++11 alias templates Add C++11 alias templates
This commit is contained in:
commit
c74397bfd0
7 changed files with 132 additions and 61 deletions
|
|
@ -2901,25 +2901,24 @@ c_declaration : c_decl {
|
|||
| USING idcolon EQUAL type plain_declarator SEMI {
|
||||
/* Convert using statement to a typedef statement */
|
||||
$$ = new_node("cdecl");
|
||||
SwigType_push($4,$5.type);
|
||||
Setattr($$,"type",$4);
|
||||
Setattr($$,"storage","typedef");
|
||||
Setattr($$,"name",$2);
|
||||
Setattr($$,"decl","");
|
||||
Setattr($$,"decl",$5.type);
|
||||
SetFlag($$,"typealias");
|
||||
add_symbols($$);
|
||||
}
|
||||
| TEMPLATE LESSTHAN template_parms GREATERTHAN USING idcolon EQUAL type plain_declarator SEMI {
|
||||
$$ = new_node("using");
|
||||
/* Convert alias template to a "template" typedef statement */
|
||||
$$ = new_node("template");
|
||||
Setattr($$,"type",$8);
|
||||
Setattr($$,"storage","typedef");
|
||||
Setattr($$,"name",$6);
|
||||
SwigType_push($8,$9.type);
|
||||
Setattr($$,"uname",$8);
|
||||
Setattr($$,"decl",$9.type);
|
||||
Setattr($$,"templateparms",$3);
|
||||
Setattr($$,"templatetype","cdecl");
|
||||
SetFlag($$,"aliastemplate");
|
||||
add_symbols($$);
|
||||
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_WARN_NODE_END($$);
|
||||
|
||||
$$ = 0; /* TODO - ignored for now */
|
||||
}
|
||||
;
|
||||
|
||||
|
|
|
|||
|
|
@ -93,8 +93,8 @@
|
|||
#define WARN_PARSE_EXTEND_NAME 326
|
||||
|
||||
#define WARN_CPP11_LAMBDA 340
|
||||
#define WARN_CPP11_ALIAS_DECLARATION 341
|
||||
#define WARN_CPP11_ALIAS_TEMPLATE 342
|
||||
#define WARN_CPP11_ALIAS_DECLARATION 341 /* redundant now */
|
||||
#define WARN_CPP11_ALIAS_TEMPLATE 342 /* redundant now */
|
||||
#define WARN_CPP11_VARIADIC_TEMPLATE 343
|
||||
|
||||
#define WARN_IGNORE_OPERATOR_NEW 350 /* new */
|
||||
|
|
@ -215,9 +215,9 @@
|
|||
/* Feel free to claim any number in this space that's not currently being used. Just make sure you
|
||||
add an entry here */
|
||||
|
||||
#define WARN_D_TYPEMAP_CTYPE_UNDEF 700
|
||||
#define WARN_D_TYPEMAP_CTYPE_UNDEF 700
|
||||
#define WARN_D_TYPEMAP_IMTYPE_UNDEF 701
|
||||
#define WARN_D_TYPEMAP_DTYPE_UNDEF 702
|
||||
#define WARN_D_TYPEMAP_DTYPE_UNDEF 702
|
||||
#define WARN_D_MULTIPLE_INHERITANCE 703
|
||||
#define WARN_D_TYPEMAP_CLASSMOD_UNDEF 704
|
||||
#define WARN_D_TYPEMAP_DBODY_UNDEF 705
|
||||
|
|
|
|||
|
|
@ -870,7 +870,7 @@ int Language::cDeclaration(Node *n) {
|
|||
} else {
|
||||
// Found an unignored templated method that has an empty template instantiation (%template())
|
||||
// Ignore it unless it has been %rename'd
|
||||
if (Strncmp(symname, "__dummy_", 8) == 0) {
|
||||
if (Strncmp(symname, "__dummy_", 8) == 0 && Cmp(storage, "typedef") != 0) {
|
||||
SetFlag(n, "feature:ignore");
|
||||
Swig_warning(WARN_LANG_TEMPLATE_METHOD_IGNORE, input_file, line_number,
|
||||
"%%template() contains no name. Template method ignored: %s\n", Swig_name_decl(n));
|
||||
|
|
|
|||
|
|
@ -566,6 +566,10 @@ class TypePass:private Dispatcher {
|
|||
SwigType_typedef_class(rname);
|
||||
Delete(rname);
|
||||
/* SwigType_typedef_class(name); */
|
||||
} else if (Strcmp(ttype, "cdecl") == 0) {
|
||||
String *rname = SwigType_typedef_resolve_all(name);
|
||||
SwigType_typedef_class(rname);
|
||||
Delete(rname);
|
||||
}
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue