Upstream version 1.3.40
[profile/ivi/swig.git] / Examples / test-suite / exception_partial_info.i
1 %module exception_partial_info
2
3 // This produced compileable code for Tcl, Python in 1.3.27, fails in 1.3.29
4
5 %{
6 #if defined(_MSC_VER)
7   #pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
8 #endif
9 %}
10
11 %{
12 class myException
13 {
14    public:
15       virtual const char *name() = 0;
16 };
17
18 class ex1 : public myException
19 {
20    public:
21       virtual const char *name() { return "ex1"; }
22 };
23
24 class ex2 : public myException
25 {
26    public:
27       virtual const char *name()  { return "ex2"; }
28 };
29 %}
30
31 #if !defined(SWIGUTL)
32
33 #if !defined(SWIGCHICKEN)
34
35 %inline %{
36 class Impl
37 {
38    public:
39       void f1() throw (myException) { ex1 e; throw e; }
40       void f2() throw (myException) { ex2 e; throw e; }
41 };
42 %}
43
44 #else
45 #warning "Chicken needs fixing for partial exception information"
46 #endif
47
48 #else
49 #warning "UTL needs fixing for partial exception information"
50 #endif
51