Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wsfulton committed Jan 24, 2017
1 parent f3029dd commit 8351913
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Source/CParse/parser.y
Expand Up @@ -372,7 +372,8 @@ static void add_symbols(Node *n) {
}

if (extendmode) {
Setattr(n,"isextendmember","1");
if (!Getattr(n, "template"))
SetFlag(n,"isextendmember");
}

if (!isfriend && inclass) {
Expand Down
5 changes: 3 additions & 2 deletions Source/Modules/lang.cxx
Expand Up @@ -1267,8 +1267,9 @@ int Language::memberfunctionHandler(Node *n) {
if (GetFlag(n, "explicitcall"))
DirectorExtraCall = CWRAP_DIRECTOR_ONE_CALL;

Swig_MethodToFunction(n, NSpace, ClassType, Getattr(n, "template") ? Extend | SmartPointer : Extend | SmartPointer | DirectorExtraCall, director_type,
is_member_director(CurrentClass, n));
int extendmember = GetFlag(n, "isextendmember") ? Extend : 0;
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);

functionWrapper(n);
Expand Down

0 comments on commit 8351913

Please sign in to comment.