Correct behaviour for templated methods used with %rename or %ignore and %template()
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9906 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
aeb132c2a6
commit
3fd28bf45c
7 changed files with 135 additions and 2 deletions
|
|
@ -185,6 +185,7 @@
|
|||
#define WARN_LANG_OVERLOAD_IGNORED 516
|
||||
#define WARN_LANG_DIRECTOR_ABSTRACT 517
|
||||
#define WARN_LANG_PORTABILITY_FILENAME 518
|
||||
#define WARN_LANG_TEMPLATE_METHOD_IGNORE 519
|
||||
|
||||
/* -- Reserved (600-799) -- */
|
||||
|
||||
|
|
|
|||
|
|
@ -819,7 +819,7 @@ int Language::cDeclaration(Node *n) {
|
|||
return SWIG_NOWRAP;
|
||||
}
|
||||
/* prevent wrapping the method twice due to overload */
|
||||
String *wrapname = NewStringf("nonpublic_%s%s", Getattr(n, "sym:name"), Getattr(n, "sym:overname"));
|
||||
String *wrapname = NewStringf("nonpublic_%s%s", symname, Getattr(n, "sym:overname"));
|
||||
if (Getattr(CurrentClass, wrapname)) {
|
||||
Delete(wrapname);
|
||||
return SWIG_NOWRAP;
|
||||
|
|
@ -959,7 +959,17 @@ int Language::cDeclaration(Node *n) {
|
|||
Delete(SwigType_pop_function(ty));
|
||||
DohIncref(type);
|
||||
Setattr(n, "type", ty);
|
||||
functionHandler(n);
|
||||
if (GetFlag(n, "feature:onlychildren") && !GetFlag(n, "feature:ignore")) {
|
||||
// Found an unignored templated method that has a an empty template instantiation (%template())
|
||||
// Ignore it unless it has been %rename'd
|
||||
if (Strncmp(symname, "__dummy_", 8) == 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", SwigType_str(decl, SwigType_namestr(Getattr(n,"name"))));
|
||||
}
|
||||
}
|
||||
if (!GetFlag(n, "feature:ignore"))
|
||||
functionHandler(n);
|
||||
Setattr(n, "type", type);
|
||||
Delete(ty);
|
||||
Delete(type);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue