Merge pull request #793 from q-p/bad_cast
Add std::bad_cast to std_except.i
This commit is contained in:
commit
5b8e8fa107
12 changed files with 24 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ public class li_std_except_runme {
|
|||
|
||||
public static void Main() {
|
||||
Test test = new Test();
|
||||
try { test.throw_bad_cast(); throw new Exception("throw_bad_cast failed"); } catch (InvalidCastException) {}
|
||||
try { test.throw_bad_exception(); throw new Exception("throw_bad_exception failed"); } catch (ApplicationException) {}
|
||||
try { test.throw_domain_error(); throw new Exception("throw_domain_error failed"); } catch (ApplicationException) {}
|
||||
try { test.throw_exception(); throw new Exception("throw_exception failed"); } catch (ApplicationException) {}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
int foo3() throw(E1) { return 0; }
|
||||
int foo4() throw(E2) { return 0; }
|
||||
// all the STL exceptions...
|
||||
void throw_bad_cast() throw(std::bad_cast) { throw std::bad_cast(); }
|
||||
void throw_bad_exception() throw(std::bad_exception) { throw std::bad_exception(); }
|
||||
void throw_domain_error() throw(std::domain_error) { throw std::domain_error("oops"); }
|
||||
void throw_exception() throw(std::exception) { throw std::exception(); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue