PageRenderTime 14ms CodeModel.GetById 11ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/template_virtual.i

#
Swig | 34 lines | 25 code | 9 blank | 0 comment | 0 complexity | a0c3d7a264ffeb9ecb1de355e46a14b4 MD5 | raw file
 1%module template_virtual
 2
 3// Submitted by Marcelo Matus  
 4// assertion emmitted with templates + derivation + pure virtual member
 5// allocate.cxx:47: int Allocate::is_abstract_inherit(Node*, Node*):
 6// Assertion `dn' failed.
 7 
 8%inline %{
 9 
10    template <class T>
11    class A
12    {
13    public:
14      virtual ~A() { }
15
16      virtual void say_hi() = 0; // only fails with pure virtual methods
17 
18      virtual void say_hello() {} // this works fine
19 
20    protected:
21      A() { }  // defined protected as swig generates constructor by default
22    };
23 
24    template <class T>
25    class B : public A<T>
26    {
27    protected:
28      B() { } // defined protected as swig generates constructor by default
29    };
30 
31%}
32 
33%template(A_int) A<int>;
34%template(B_int) B<int>;  // !!!! it crashes right here !!!!!