aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/cpp11_noexcept.i
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2013-11-21 19:31:59 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2013-11-21 20:20:56 +0000
commitf4ada30a7e6f0b15ed4a1446675980b6df15b631 (patch)
tree8e515b4e9c38bc523618ff7520a01a8f35b75b16 /Examples/test-suite/cpp11_noexcept.i
parentcdefaaf794398655de5e93c4aa9f20fdb01e2283 (diff)
downloadswig-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.i48
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;
+};
+
+%}
+