Now, this is a real broken case
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4374 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
02598af321
commit
1311eb70bb
2 changed files with 49 additions and 25 deletions
|
|
@ -6,26 +6,53 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
|
|
||||||
struct Engine
|
enum FieldDim {
|
||||||
{
|
UnaryField,
|
||||||
};
|
BinaryField
|
||||||
|
|
||||||
struct Object
|
|
||||||
{
|
|
||||||
virtual bool write(Engine& archive) const = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class A : public Object
|
|
||||||
{
|
|
||||||
A(int a = 0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool write(Engine& archive) const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <FieldDim Dim>
|
||||||
|
class Facet;
|
||||||
|
|
||||||
|
|
||||||
|
template <FieldDim Dim>
|
||||||
|
struct Base
|
||||||
|
{
|
||||||
|
typedef unsigned int size_type;
|
||||||
|
typedef Facet<Dim>* facet_ptr;
|
||||||
|
|
||||||
|
// This works
|
||||||
|
// virtual Facet<Dim>* set(size_type) = 0;
|
||||||
|
|
||||||
|
// This doesn't
|
||||||
|
virtual facet_ptr set(size_type) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
template <FieldDim Dim>
|
||||||
|
struct Facet
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
template <FieldDim Dim>
|
||||||
|
struct A : Base<Dim>
|
||||||
|
{
|
||||||
|
typedef Base<Dim> base;
|
||||||
|
typedef typename base::size_type size_type;
|
||||||
|
|
||||||
|
A(int a = 0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
Facet<Dim>* set(size_type)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
%template(Base_UF) Base<UnaryField>;
|
||||||
|
%template(A_UF) A<UnaryField>;
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,8 @@
|
||||||
from abstract_typedef2 import *
|
from abstract_typedef2 import *
|
||||||
e = Engine()
|
|
||||||
|
|
||||||
a = A()
|
a = A_UF()
|
||||||
|
|
||||||
|
|
||||||
if a.write(e) != 1:
|
|
||||||
raise RuntimeError
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue