diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2013-11-21 19:31:59 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2013-11-21 20:20:56 +0000 |
commit | f4ada30a7e6f0b15ed4a1446675980b6df15b631 (patch) | |
tree | 8e515b4e9c38bc523618ff7520a01a8f35b75b16 /Examples/test-suite/cpp11_noexcept.i | |
parent | cdefaaf794398655de5e93c4aa9f20fdb01e2283 (diff) | |
download | swig-f4ada30a7e6f0b15ed4a1446675980b6df15b631.tar.gz |
Add support for C++11 noexcept specification in exception specifications
Diffstat (limited to 'Examples/test-suite/cpp11_noexcept.i')
-rw-r--r-- | Examples/test-suite/cpp11_noexcept.i | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/Examples/test-suite/cpp11_noexcept.i b/Examples/test-suite/cpp11_noexcept.i new file mode 100644 index 000000000..27476fa70 --- /dev/null +++ b/Examples/test-suite/cpp11_noexcept.i @@ -0,0 +1,48 @@ +%module cpp11_noexcept + +%ignore NoExceptClass(NoExceptClass&&); +%rename(Assignment) NoExceptClass::operator=; + +%inline %{ + +extern "C" void global_noexcept(int, bool) noexcept; + +struct NoExceptClass { + static const bool VeryTrue = true; + + NoExceptClass() noexcept {} + NoExceptClass(const NoExceptClass&) noexcept {} + NoExceptClass(NoExceptClass&&) noexcept {} + NoExceptClass& operator=(const NoExceptClass&) noexcept {} + ~NoExceptClass() noexcept {} + + void noex0() noexcept {} + void noex1() noexcept(sizeof(int) == 4) {} + void noex2() noexcept(true) {} + void noex3() noexcept(false) {} + void noex4() noexcept(VeryTrue) {} + + template<typename T> void template_noexcept(T) noexcept {} + + void noo1() const noexcept {} + static void noo2() noexcept {} + virtual void noo3() const noexcept {} + virtual void noo4() const noexcept = delete; + virtual void noo5() const throw() = delete; +}; + +struct NoExceptAbstract { + virtual void noo4() const noexcept = 0; + virtual ~NoExceptAbstract() noexcept = 0; +}; + +struct NoExceptDefaultDelete { +// NoExceptDefaultDelete() noexcept = default; +// NoExceptDefaultDelete(const NoExceptDefaultDelete&) noexcept = delete; + NoExceptDefaultDelete(NoExceptDefaultDelete&&) = delete; + NoExceptDefaultDelete& operator=(const NoExceptDefaultDelete&) = delete; + ~NoExceptDefaultDelete() noexcept = default; +}; + +%} + |