Fixed problem with smart pointers and overloaded static methods.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5190 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
a377e7f9f0
commit
ff1bedc094
3 changed files with 27 additions and 7 deletions
|
|
@ -493,6 +493,13 @@ public:
|
||||||
if (checkAttribute(n, "storage", "virtual"))
|
if (checkAttribute(n, "storage", "virtual"))
|
||||||
class_member_is_defined_in_bases(n, inclass);
|
class_member_is_defined_in_bases(n, inclass);
|
||||||
|
|
||||||
|
/* Check to see if this is a static member or not. If so, we add an attribute
|
||||||
|
cplus:staticbase that saves the current class */
|
||||||
|
|
||||||
|
if (checkAttribute(n,"storage","static")) {
|
||||||
|
Setattr(n,"cplus:staticbase", inclass);
|
||||||
|
}
|
||||||
|
|
||||||
String *name = Getattr(n,"name");
|
String *name = Getattr(n,"name");
|
||||||
if (cplus_mode != PUBLIC) {
|
if (cplus_mode != PUBLIC) {
|
||||||
/* Look for a private assignment operator */
|
/* Look for a private assignment operator */
|
||||||
|
|
@ -522,6 +529,7 @@ public:
|
||||||
}
|
}
|
||||||
List *methods = smart_pointer_methods(sc,0,isconst);
|
List *methods = smart_pointer_methods(sc,0,isconst);
|
||||||
Setattr(inclass,"allocate:smartpointer",methods);
|
Setattr(inclass,"allocate:smartpointer",methods);
|
||||||
|
Setattr(inclass,"allocate:smartpointerbase",base);
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
/* Hmmm. The return value is not a pointer. If the type is a value
|
/* Hmmm. The return value is not a pointer. If the type is a value
|
||||||
|
|
|
||||||
|
|
@ -1014,7 +1014,12 @@ Language::staticmemberfunctionHandler(Node *n) {
|
||||||
String *cname, *mrename;
|
String *cname, *mrename;
|
||||||
|
|
||||||
if (!Extend) {
|
if (!Extend) {
|
||||||
|
String *sname = Getattr(Getattr(n,"cplus:staticbase"),"name");
|
||||||
|
if (sname) {
|
||||||
|
cname = NewStringf("%s::%s",sname,name);
|
||||||
|
} else {
|
||||||
cname = NewStringf("%s::%s",ClassName,name);
|
cname = NewStringf("%s::%s",ClassName,name);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
cname = Copy(Swig_name_member(ClassPrefix,name));
|
cname = Copy(Swig_name_member(ClassPrefix,name));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,15 @@ Swig_overload_rank(Node *n) {
|
||||||
|
|
||||||
c = o;
|
c = o;
|
||||||
while (c) {
|
while (c) {
|
||||||
if (!Getattr(c,"error")) {
|
if (Getattr(c,"error")) {
|
||||||
|
c = Getattr(c,"sym:nextSibling");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
/* if (SmartPointer && Getattr(c,"cplus:staticbase")) {
|
||||||
|
c = Getattr(c,"sym:nextSibling");
|
||||||
|
continue;
|
||||||
|
} */
|
||||||
|
|
||||||
if (Getattr(c,"wrap:name")) {
|
if (Getattr(c,"wrap:name")) {
|
||||||
nodes[nnodes].n = c;
|
nodes[nnodes].n = c;
|
||||||
nodes[nnodes].parms = Getattr(c,"wrap:parms");
|
nodes[nnodes].parms = Getattr(c,"wrap:parms");
|
||||||
|
|
@ -53,7 +61,6 @@ Swig_overload_rank(Node *n) {
|
||||||
nodes[nnodes].error = 0;
|
nodes[nnodes].error = 0;
|
||||||
nnodes++;
|
nnodes++;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
c = Getattr(c,"sym:nextSibling");
|
c = Getattr(c,"sym:nextSibling");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue