Tweak %extend templates

Previous commit turned on the generation of an extra extend function
wrapper of a member template function when %template was inside a %extend
block instead of calling the real member template - reversed this side
effect.
This commit is contained in:
William S Fulton 2017-01-23 23:21:20 +00:00
commit 83519138e8
2 changed files with 5 additions and 3 deletions

View file

@ -372,7 +372,8 @@ static void add_symbols(Node *n) {
} }
if (extendmode) { if (extendmode) {
Setattr(n,"isextendmember","1"); if (!Getattr(n, "template"))
SetFlag(n,"isextendmember");
} }
if (!isfriend && inclass) { if (!isfriend && inclass) {

View file

@ -1267,8 +1267,9 @@ int Language::memberfunctionHandler(Node *n) {
if (GetFlag(n, "explicitcall")) if (GetFlag(n, "explicitcall"))
DirectorExtraCall = CWRAP_DIRECTOR_ONE_CALL; DirectorExtraCall = CWRAP_DIRECTOR_ONE_CALL;
Swig_MethodToFunction(n, NSpace, ClassType, Getattr(n, "template") ? Extend | SmartPointer : Extend | SmartPointer | DirectorExtraCall, director_type, int extendmember = GetFlag(n, "isextendmember") ? Extend : 0;
is_member_director(CurrentClass, n)); int flags = Getattr(n, "template") ? extendmember | SmartPointer : Extend | SmartPointer | DirectorExtraCall;
Swig_MethodToFunction(n, NSpace, ClassType, flags, director_type, is_member_director(CurrentClass, n));
Setattr(n, "sym:name", fname); Setattr(n, "sym:name", fname);
functionWrapper(n); functionWrapper(n);