Fix compilation error when using directors on protected virtual overloaded methods reported by Sam Hendley.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11062 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
e604e46b17
commit
d029d0a627
4 changed files with 37 additions and 6 deletions
|
|
@ -830,9 +830,8 @@ int Language::cDeclaration(Node *n) {
|
|||
if (!(directorsEnabled() && ((is_member_director(CurrentClass, n) && need_nonpublic_member(n)) || is_non_virtual_protected_access(n)))) {
|
||||
return SWIG_NOWRAP;
|
||||
}
|
||||
#if 0
|
||||
// I don't see why this is needed - WSF
|
||||
/* prevent wrapping the method twice due to overload */
|
||||
// Prevent wrapping protected overloaded director methods more than once -
|
||||
// This bit of code is only needed due to the cDeclaration call in classHandler()
|
||||
String *wrapname = NewStringf("nonpublic_%s%s", symname, Getattr(n, "sym:overname"));
|
||||
if (Getattr(CurrentClass, wrapname)) {
|
||||
Delete(wrapname);
|
||||
|
|
@ -840,7 +839,6 @@ int Language::cDeclaration(Node *n) {
|
|||
}
|
||||
SetFlag(CurrentClass, wrapname);
|
||||
Delete(wrapname);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2476,6 +2474,13 @@ int Language::classHandler(Node *n) {
|
|||
Node *m = Copy(method);
|
||||
Setattr(m, "director", "1");
|
||||
Setattr(m, "parentNode", n);
|
||||
/*
|
||||
* There is a bug that needs fixing still...
|
||||
* This area of code is creating methods which have not been overidden in a derived class (director methods that are protected in the base)
|
||||
* If the method is overloaded, then Swig_overload_dispatch() incorrectly generates a call to the base wrapper, _wrap_xxx method
|
||||
* See director_protected_overloaded.i - Possibly sym:overname needs correcting here.
|
||||
Printf(stdout, "new method: %s::%s(%s)\n", Getattr(parentNode(m), "name"), Getattr(m, "name"), ParmList_str_defaultargs(Getattr(m, "parms")));
|
||||
*/
|
||||
cDeclaration(m);
|
||||
Delete(m);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue