Smart pointer to %ignored class doesn't expose inherited methods fix.
Regression introduced in swig-3.0.9 by 3efdbc8
Closes #690
This commit is contained in:
parent
8aea57c704
commit
b9ca9f5efc
5 changed files with 58 additions and 3 deletions
|
|
@ -5,3 +5,6 @@ See the RELEASENOTES file for a summary of changes in each release.
|
||||||
Version 3.0.10 (in progress)
|
Version 3.0.10 (in progress)
|
||||||
============================
|
============================
|
||||||
|
|
||||||
|
2016-05-31: wsfulton
|
||||||
|
Fix #690 - Smart pointer to %ignored class doesn't expose inherited methods.
|
||||||
|
Regression introduced in swig-3.0.9.
|
||||||
|
|
|
||||||
|
|
@ -363,6 +363,7 @@ CPP_TEST_CASES += \
|
||||||
smart_pointer_const2 \
|
smart_pointer_const2 \
|
||||||
smart_pointer_const_overload \
|
smart_pointer_const_overload \
|
||||||
smart_pointer_extend \
|
smart_pointer_extend \
|
||||||
|
smart_pointer_ignore \
|
||||||
smart_pointer_member \
|
smart_pointer_member \
|
||||||
smart_pointer_multi \
|
smart_pointer_multi \
|
||||||
smart_pointer_multi_typedef \
|
smart_pointer_multi_typedef \
|
||||||
|
|
|
||||||
19
Examples/test-suite/java/smart_pointer_ignore_runme.java
Normal file
19
Examples/test-suite/java/smart_pointer_ignore_runme.java
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
import smart_pointer_ignore.*;
|
||||||
|
|
||||||
|
public class smart_pointer_ignore_runme {
|
||||||
|
|
||||||
|
static {
|
||||||
|
try {
|
||||||
|
System.loadLibrary("smart_pointer_ignore");
|
||||||
|
} catch (UnsatisfiedLinkError e) {
|
||||||
|
System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String argv[]) {
|
||||||
|
DerivedPtr d = smart_pointer_ignore.makeDerived();
|
||||||
|
d.base();
|
||||||
|
d.derived();
|
||||||
|
}
|
||||||
|
}
|
||||||
33
Examples/test-suite/smart_pointer_ignore.i
Normal file
33
Examples/test-suite/smart_pointer_ignore.i
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
%module smart_pointer_ignore
|
||||||
|
|
||||||
|
|
||||||
|
%ignore Derived;
|
||||||
|
|
||||||
|
%inline %{
|
||||||
|
class Base {
|
||||||
|
public:
|
||||||
|
void base() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
class Derived : public Base {
|
||||||
|
public:
|
||||||
|
void derived() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
class Ptr {
|
||||||
|
public:
|
||||||
|
Ptr(T *t) : ptr(t) {}
|
||||||
|
T * operator->() const { return ptr; }
|
||||||
|
private:
|
||||||
|
T *ptr;
|
||||||
|
};
|
||||||
|
%}
|
||||||
|
|
||||||
|
%template(DerivedPtr) Ptr<Derived>;
|
||||||
|
|
||||||
|
%inline %{
|
||||||
|
Ptr<Derived> makeDerived() {
|
||||||
|
return Ptr<Derived>(new Derived());
|
||||||
|
}
|
||||||
|
%}
|
||||||
|
|
@ -224,7 +224,7 @@ class TypePass:private Dispatcher {
|
||||||
if (tname)
|
if (tname)
|
||||||
Delete(tname);
|
Delete(tname);
|
||||||
if (!bcls) {
|
if (!bcls) {
|
||||||
if (!clsforward) {
|
if (!clsforward && !GetFlag(cls, "feature:ignore")) {
|
||||||
if (ispublic && !Getmeta(bname, "already_warned")) {
|
if (ispublic && !Getmeta(bname, "already_warned")) {
|
||||||
Swig_warning(WARN_TYPE_UNDEFINED_CLASS, Getfile(bname), Getline(bname), "Nothing known about base class '%s'. Ignored.\n", SwigType_namestr(bname));
|
Swig_warning(WARN_TYPE_UNDEFINED_CLASS, Getfile(bname), Getline(bname), "Nothing known about base class '%s'. Ignored.\n", SwigType_namestr(bname));
|
||||||
if (Strchr(bname, '<')) {
|
if (Strchr(bname, '<')) {
|
||||||
|
|
@ -503,7 +503,6 @@ class TypePass:private Dispatcher {
|
||||||
/* Inherit type definitions into the class */
|
/* Inherit type definitions into the class */
|
||||||
if (name && !(GetFlag(n, "nested") && !checkAttribute(n, "access", "public") &&
|
if (name && !(GetFlag(n, "nested") && !checkAttribute(n, "access", "public") &&
|
||||||
(GetFlag(n, "feature:flatnested") || Language::instance()->nestedClassesSupport() == Language::NCS_None))) {
|
(GetFlag(n, "feature:flatnested") || Language::instance()->nestedClassesSupport() == Language::NCS_None))) {
|
||||||
if (!GetFlag(n, "feature:ignore"))
|
|
||||||
cplus_inherit_types(n, 0, nname ? nname : (fname ? fname : name));
|
cplus_inherit_types(n, 0, nname ? nname : (fname ? fname : name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue