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:
William S Fulton 2014-03-06 19:42:57 +00:00
commit dbf44fc181
6 changed files with 70 additions and 7 deletions

View file

@ -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");