Fix std::map and smart pointers.
Fixes problem with method overloading when some methods are added by %extend and others are real methods and using template default parameters with smart pointers. This is noticeable as a regression since 2.0.12 when using the default smart pointer handling for some languages when the smart pointer wraps std::map and other STL containers. Fixes SF Bug 1363
This commit is contained in:
parent
c99417ab13
commit
dbf44fc181
6 changed files with 70 additions and 7 deletions
|
|
@ -421,7 +421,7 @@ class Allocate:public Dispatcher {
|
|||
while (cc) {
|
||||
Node *cp = cc;
|
||||
if (classname) {
|
||||
Setattr(cp, "classname", classname);
|
||||
Setattr(cp, "extendsmartclassname", classname);
|
||||
}
|
||||
Setattr(cp, "allocate:smartpointeraccess", "1");
|
||||
/* If constant, we have to be careful */
|
||||
|
|
@ -827,7 +827,7 @@ Allocate():
|
|||
}
|
||||
List *methods = smart_pointer_methods(sc, 0, isconst);
|
||||
Setattr(inclass, "allocate:smartpointer", methods);
|
||||
Setattr(inclass, "allocate:smartpointerbase", base);
|
||||
Setattr(inclass, "allocate:smartpointerpointeeclassname", Getattr(sc, "name"));
|
||||
} else {
|
||||
/* Hmmm. The return value is not a pointer. If the type is a value
|
||||
or reference. We're going to chase it to see if another operator->()
|
||||
|
|
|
|||
|
|
@ -1242,8 +1242,8 @@ int Language::memberfunctionHandler(Node *n) {
|
|||
|
||||
String *fname = Swig_name_member(NSpace, ClassPrefix, symname);
|
||||
if (Extend && SmartPointer) {
|
||||
if (!Getattr(n, "classname")) {
|
||||
Setattr(n, "classname", Getattr(CurrentClass, "allocate:smartpointerbase"));
|
||||
if (!Getattr(n, "extendsmartclassname")) {
|
||||
Setattr(n, "extendsmartclassname", Getattr(CurrentClass, "allocate:smartpointerpointeeclassname"));
|
||||
}
|
||||
}
|
||||
// Set up the type for the cast to this class for use when wrapping const director (virtual) methods.
|
||||
|
|
@ -1562,7 +1562,7 @@ int Language::membervariableHandler(Node *n) {
|
|||
int Language::staticmembervariableHandler(Node *n) {
|
||||
Swig_require("staticmembervariableHandler", n, "*name", "*sym:name", "*type", "?value", NIL);
|
||||
String *value = Getattr(n, "value");
|
||||
String *classname = !SmartPointer ? (isNonVirtualProtectedAccess(n) ? DirectorClassName : ClassName) : Getattr(CurrentClass, "allocate:smartpointerbase");
|
||||
String *classname = !SmartPointer ? (isNonVirtualProtectedAccess(n) ? DirectorClassName : ClassName) : Getattr(CurrentClass, "allocate:smartpointerpointeeclassname");
|
||||
|
||||
if (!value || !Getattr(n, "hasconsttype")) {
|
||||
String *name = Getattr(n, "name");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue