better support for the %throws directive

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8350 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2006-01-10 17:19:22 +00:00
commit b044703d0d
5 changed files with 71 additions and 32 deletions

View file

@ -15,7 +15,7 @@
}
}
%throws(E1,E2) A::barfoo(int i);
%throws(E1,E2*,ET<int>,ET<double>) A::barfoo(int i);
%inline %{
@ -31,6 +31,11 @@
{
};
template <class T>
struct ET
{
};
struct A
{
/* caught by the user's throw definition */
@ -58,10 +63,18 @@
{
if (i == 1) {
throw E1();
} else {
throw E2();
} else if (i == 2) {
static E2 *ep = new E2();
throw ep;
} else if (i == 3) {
throw ET<int>();
} else {
throw ET<double>();
}
return 0;
}
};
%}
%template(ET_i) ET<int>;
%template(ET_d) ET<double>;