diff options
Diffstat (limited to 'Examples/test-suite/template_inherit_abstract.i')
-rw-r--r-- | Examples/test-suite/template_inherit_abstract.i | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/Examples/test-suite/template_inherit_abstract.i b/Examples/test-suite/template_inherit_abstract.i new file mode 100644 index 000000000..8cd0b998d --- /dev/null +++ b/Examples/test-suite/template_inherit_abstract.i @@ -0,0 +1,59 @@ +%module template_inherit_abstract + +%warnfilter(801) oss::test; /* Ruby, wrong class name */ +%warnfilter(802, 813) oss::Module; /* Ruby & Java, multiple inheritance */ + +%inline %{ + + namespace oss + { + template <class C> + struct Wrap + { + }; + + struct ModuleBase + { + virtual ~ModuleBase() {} + virtual int get() = 0; + }; + + template <class C> + struct Module : C, ModuleBase + { + protected: + Module() {} + }; + + template <class C> + struct HModule : Module<Wrap<C> > + { + // virtual int get(); // declaration here works + + protected: + HModule() {} + }; + } + + struct B + { + }; + +%} + +namespace oss +{ + %template(Wrap_B) Wrap<B>; + %template(Module_B) Module<Wrap<B> >; + %template(HModule_B) HModule<B>; +} + +%inline %{ + namespace oss + { + struct test : HModule<B> + { + virtual int get() {return 0;} // declaration here breaks swig + }; + } +%} |