Add warnings for badly named destructors. Fix %extend and destructors for templates - they weren't always being wrapped. Fix destructor "name" attribute.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12804 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
7d359b7895
commit
4c6f66577a
10 changed files with 226 additions and 28 deletions
104
Examples/test-suite/errors/cpp_extend_destructors.i
Normal file
104
Examples/test-suite/errors/cpp_extend_destructors.i
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
%module xxx
|
||||
|
||||
/////////////////////////////
|
||||
%extend AStruct {
|
||||
~AStruct() {}
|
||||
}
|
||||
struct AStruct {
|
||||
~AStruct() {}
|
||||
};
|
||||
|
||||
/////////////////////////////
|
||||
struct BStruct {
|
||||
~BStruct() {}
|
||||
~BStruct() {}
|
||||
};
|
||||
|
||||
/////////////////////////////
|
||||
struct CStruct {
|
||||
};
|
||||
|
||||
%extend CStruct {
|
||||
~NOT_CStruct() {
|
||||
delete $self;
|
||||
}
|
||||
}
|
||||
|
||||
%extend DStruct {
|
||||
~NOT_DStruct() {
|
||||
delete $self;
|
||||
}
|
||||
}
|
||||
|
||||
struct DStruct {
|
||||
};
|
||||
|
||||
/////////////////////////////
|
||||
struct EStruct {
|
||||
~EStruct() {}
|
||||
};
|
||||
|
||||
%extend EStruct {
|
||||
~NOT_EStruct() {
|
||||
delete $self;
|
||||
}
|
||||
}
|
||||
|
||||
%extend FStruct {
|
||||
~NOT_FStruct() {
|
||||
delete $self;
|
||||
}
|
||||
}
|
||||
|
||||
struct FStruct {
|
||||
~FStruct() {}
|
||||
};
|
||||
|
||||
/////////////////////////////
|
||||
struct GStruct {
|
||||
};
|
||||
|
||||
%extend GStruct {
|
||||
~GStruct() {}
|
||||
~NOT_GStruct() {
|
||||
delete $self;
|
||||
}
|
||||
}
|
||||
|
||||
%extend HStruct {
|
||||
~HStruct() {}
|
||||
~NOT_HStruct() {
|
||||
delete $self;
|
||||
}
|
||||
}
|
||||
|
||||
struct HStruct {
|
||||
};
|
||||
|
||||
/////////////////////////////
|
||||
struct IStruct {
|
||||
~IStruct() {}
|
||||
~NOT_IStruct() {}
|
||||
};
|
||||
|
||||
struct JStruct {
|
||||
~JStruct() {}
|
||||
~NOT_JStruct() {}
|
||||
~JStruct() {}
|
||||
};
|
||||
|
||||
/////////////////////////////
|
||||
struct KStruct {
|
||||
~NOT_KStruct() {}
|
||||
};
|
||||
|
||||
/////////////////////////////
|
||||
template<typename T>
|
||||
struct LStruct {
|
||||
~LStruct() {}
|
||||
~NOT_LStruct() {}
|
||||
~LStruct() {}
|
||||
};
|
||||
%template(LStructInt) LStruct<int>;
|
||||
%template(LStructShort) LStruct<short>;
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue