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
|
|
@ -3,8 +3,12 @@ Version 1.3.37 (30 December 2008)
|
||||||
|
|
||||||
2009-01-13: mgossage
|
2009-01-13: mgossage
|
||||||
[Lua] Added contract support for requiring that unsigned numbers are >=0
|
[Lua] Added contract support for requiring that unsigned numbers are >=0
|
||||||
Rewrote much of Examples/Lua/embed3.
|
Rewrote much of Examples/Lua/embed3.
|
||||||
Added a lot of to the Lua documentation.
|
Added a lot to the Lua documentation.
|
||||||
|
|
||||||
|
2009-01-13: wsfulton
|
||||||
|
Fix compilation error when using directors on protected virtual overloaded
|
||||||
|
methods reported by Sam Hendley.
|
||||||
|
|
||||||
2009-01-12: drjoe
|
2009-01-12: drjoe
|
||||||
Fixed handling of integer arrays
|
Fixed handling of integer arrays
|
||||||
|
|
|
||||||
|
|
@ -166,6 +166,7 @@ CPP_TEST_CASES += \
|
||||||
director_overload \
|
director_overload \
|
||||||
director_primitives \
|
director_primitives \
|
||||||
director_protected \
|
director_protected \
|
||||||
|
director_protected_overloaded \
|
||||||
director_redefined \
|
director_redefined \
|
||||||
director_thread \
|
director_thread \
|
||||||
director_unroll \
|
director_unroll \
|
||||||
|
|
|
||||||
21
Examples/test-suite/director_protected_overloaded.i
Normal file
21
Examples/test-suite/director_protected_overloaded.i
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
%module(directors="1",dirprot="1") director_protected_overloaded
|
||||||
|
|
||||||
|
%director IDataObserver;
|
||||||
|
%director DerivedDataObserver;
|
||||||
|
|
||||||
|
// protected overloaded methods
|
||||||
|
%inline %{
|
||||||
|
class IDataObserver
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~IDataObserver(){}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void notoverloaded() = 0;
|
||||||
|
virtual void isoverloaded() = 0;
|
||||||
|
virtual void isoverloaded(int i) = 0;
|
||||||
|
virtual void isoverloaded(int i, double d) = 0;
|
||||||
|
};
|
||||||
|
class DerivedDataObserver : public IDataObserver {
|
||||||
|
};
|
||||||
|
%}
|
||||||
|
|
@ -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)))) {
|
if (!(directorsEnabled() && ((is_member_director(CurrentClass, n) && need_nonpublic_member(n)) || is_non_virtual_protected_access(n)))) {
|
||||||
return SWIG_NOWRAP;
|
return SWIG_NOWRAP;
|
||||||
}
|
}
|
||||||
#if 0
|
// Prevent wrapping protected overloaded director methods more than once -
|
||||||
// I don't see why this is needed - WSF
|
// This bit of code is only needed due to the cDeclaration call in classHandler()
|
||||||
/* prevent wrapping the method twice due to overload */
|
|
||||||
String *wrapname = NewStringf("nonpublic_%s%s", symname, Getattr(n, "sym:overname"));
|
String *wrapname = NewStringf("nonpublic_%s%s", symname, Getattr(n, "sym:overname"));
|
||||||
if (Getattr(CurrentClass, wrapname)) {
|
if (Getattr(CurrentClass, wrapname)) {
|
||||||
Delete(wrapname);
|
Delete(wrapname);
|
||||||
|
|
@ -840,7 +839,6 @@ int Language::cDeclaration(Node *n) {
|
||||||
}
|
}
|
||||||
SetFlag(CurrentClass, wrapname);
|
SetFlag(CurrentClass, wrapname);
|
||||||
Delete(wrapname);
|
Delete(wrapname);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2476,6 +2474,13 @@ int Language::classHandler(Node *n) {
|
||||||
Node *m = Copy(method);
|
Node *m = Copy(method);
|
||||||
Setattr(m, "director", "1");
|
Setattr(m, "director", "1");
|
||||||
Setattr(m, "parentNode", n);
|
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);
|
cDeclaration(m);
|
||||||
Delete(m);
|
Delete(m);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue