fix overload + protected member issue reported by Colin McDonald
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8851 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
a66fa50a8c
commit
0e217ce9fb
3 changed files with 22 additions and 4 deletions
|
|
@ -165,3 +165,15 @@ long long ll(long long ull) { return ull; }
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
%inline {
|
||||||
|
class ClassA
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ClassA() {}
|
||||||
|
int method1( int arg1 ) {return arg1;}
|
||||||
|
protected:
|
||||||
|
int method1( int arg1, int arg2 ) {return arg1 + arg2;}
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -96,3 +96,7 @@ if s.type != "void *":
|
||||||
|
|
||||||
|
|
||||||
free_void(v)
|
free_void(v)
|
||||||
|
|
||||||
|
|
||||||
|
a = ClassA()
|
||||||
|
b = a.method1(1)
|
||||||
|
|
|
||||||
|
|
@ -49,10 +49,12 @@ void clean_overloaded(Node *n) {
|
||||||
Node *first = 0;
|
Node *first = 0;
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
while (nn) {
|
while (nn) {
|
||||||
if ((Strcmp(nodeType(nn),"template") == 0) ||
|
String *ntype = nodeType(nn);
|
||||||
(GetFlag(nn,"feature:ignore")) ||
|
if ((GetFlag(nn,"feature:ignore")) ||
|
||||||
(Getattr(nn,"error")) ||
|
(Getattr(nn,"error")) ||
|
||||||
((Strcmp(nodeType(nn),"using") == 0) && !firstChild(nn))) {
|
(Strcmp(ntype,"template") == 0) ||
|
||||||
|
((Strcmp(ntype,"cdecl") == 0) && is_protected(n) && !is_member_director(n)) ||
|
||||||
|
((Strcmp(ntype,"using") == 0) && !firstChild(nn))) {
|
||||||
/* Remove from overloaded list */
|
/* Remove from overloaded list */
|
||||||
Node *ps = Getattr(nn,"sym:previousSibling");
|
Node *ps = Getattr(nn,"sym:previousSibling");
|
||||||
Node *ns = Getattr(nn,"sym:nextSibling");
|
Node *ns = Getattr(nn,"sym:nextSibling");
|
||||||
|
|
@ -67,7 +69,7 @@ void clean_overloaded(Node *n) {
|
||||||
Delattr(nn,"sym:overloaded");
|
Delattr(nn,"sym:overloaded");
|
||||||
nn = ns;
|
nn = ns;
|
||||||
continue;
|
continue;
|
||||||
} else if ((Strcmp(nodeType(nn),"using") == 0)) {
|
} else if ((Strcmp(ntype,"using") == 0)) {
|
||||||
/* A possibly dangerous parse tree hack. We're going to
|
/* A possibly dangerous parse tree hack. We're going to
|
||||||
cut the parse tree node out and stick in the resolved
|
cut the parse tree node out and stick in the resolved
|
||||||
using declarations */
|
using declarations */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue