From 60fca08fd85b24db65ddd6a7eb4329e167a96cf8 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Tue, 21 Feb 2006 11:09:05 +0000 Subject: [PATCH] fix previous overload +protected member issue, as reported by Colin McDonald git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8855 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Examples/test-suite/overload_simple.i | 1 + Source/Modules/utils.cxx | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Examples/test-suite/overload_simple.i b/Examples/test-suite/overload_simple.i index 417e4636e..a97de8abe 100644 --- a/Examples/test-suite/overload_simple.i +++ b/Examples/test-suite/overload_simple.i @@ -171,6 +171,7 @@ long long ll(long long ull) { return ull; } { public: ClassA() {} + int method1( ) {return 0;} int method1( int arg1 ) {return arg1;} protected: int method1( int arg1, int arg2 ) {return arg1 + arg2;} diff --git a/Source/Modules/utils.cxx b/Source/Modules/utils.cxx index 92631c4c5..65a90ed4c 100644 --- a/Source/Modules/utils.cxx +++ b/Source/Modules/utils.cxx @@ -27,7 +27,7 @@ int is_member_director(Node* parentnode, Node* member) if (parentnode && checkAttribute(member, "storage", "virtual")) { int parent_nodirector = GetFlag(parentnode,"feature:nodirector"); if (parent_nodirector) return 0; - int parent_director = director_mode || GetFlag(parentnode,"feature:director"); + int parent_director = director_mode && GetFlag(parentnode,"feature:director"); int cdecl_director = parent_director || GetFlag(member,"feature:director"); int cdecl_nodirector = GetFlag(member,"feature:nodirector"); return cdecl_director && !cdecl_nodirector; @@ -53,7 +53,7 @@ void clean_overloaded(Node *n) { if ((GetFlag(nn,"feature:ignore")) || (Getattr(nn,"error")) || (Strcmp(ntype,"template") == 0) || - ((Strcmp(ntype,"cdecl") == 0) && is_protected(n) && !is_member_director(n)) || + ((Strcmp(ntype,"cdecl") == 0) && is_protected(nn) && !is_member_director(nn)) || ((Strcmp(ntype,"using") == 0) && !firstChild(nn))) { /* Remove from overloaded list */ Node *ps = Getattr(nn,"sym:previousSibling");