summaryrefslogtreecommitdiff
path: root/Examples/test-suite
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite')
-rw-r--r--Examples/test-suite/catches.i12
-rw-r--r--Examples/test-suite/cplusplus_throw.i12
-rw-r--r--Examples/test-suite/csharp_exceptions.i13
-rw-r--r--Examples/test-suite/default_args.i12
-rw-r--r--Examples/test-suite/director_exception.i4
-rw-r--r--Examples/test-suite/exception_order.i13
-rw-r--r--Examples/test-suite/extern_throws.i12
-rw-r--r--Examples/test-suite/java_director_exception_feature.i7
-rw-r--r--Examples/test-suite/java_director_exception_feature_nspace.i7
-rw-r--r--Examples/test-suite/java_throws.i9
-rw-r--r--Examples/test-suite/li_std_except.i14
-rw-r--r--Examples/test-suite/li_std_except_as_class.i13
-rw-r--r--Examples/test-suite/li_std_string.i23
-rw-r--r--Examples/test-suite/li_std_wstring.i7
-rw-r--r--Examples/test-suite/primitive_types.i4
-rw-r--r--Examples/test-suite/python_builtin.i13
-rw-r--r--Examples/test-suite/threads_exception.i11
-rw-r--r--Examples/test-suite/throw_exception.i12
-rw-r--r--Examples/test-suite/using_pointers.i12
19 files changed, 201 insertions, 9 deletions
diff --git a/Examples/test-suite/catches.i b/Examples/test-suite/catches.i
index 8f09ae24c..8456cc00b 100644
--- a/Examples/test-suite/catches.i
+++ b/Examples/test-suite/catches.i
@@ -4,6 +4,10 @@
#if defined(_MSC_VER)
#pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated in C++11
+#endif
%}
%include <exception.i> // for throws(...) typemap
@@ -31,3 +35,11 @@ void test_catches_all(int i) {
}
%}
+%{
+#if defined(_MSC_VER)
+ #pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
+#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic pop
+#endif
+%}
diff --git a/Examples/test-suite/cplusplus_throw.i b/Examples/test-suite/cplusplus_throw.i
index 3b11c48ca..112f9f3b5 100644
--- a/Examples/test-suite/cplusplus_throw.i
+++ b/Examples/test-suite/cplusplus_throw.i
@@ -9,6 +9,10 @@
#if defined(_MSC_VER)
#pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated in C++11
+#endif
%}
%nodefaultctor;
@@ -26,3 +30,11 @@ public:
%}
+%{
+#if defined(_MSC_VER)
+ #pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
+#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic pop
+#endif
+%}
diff --git a/Examples/test-suite/csharp_exceptions.i b/Examples/test-suite/csharp_exceptions.i
index e5b4d495b..53e51eb09 100644
--- a/Examples/test-suite/csharp_exceptions.i
+++ b/Examples/test-suite/csharp_exceptions.i
@@ -40,6 +40,10 @@
#if defined(_MSC_VER)
#pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated in C++11
+#endif
// %exception tests
void ThrowByValue() { throw Ex("ThrowByValue"); }
@@ -239,3 +243,12 @@ struct ThrowsClass {
%inline %{
void InnerExceptionTest() { throw Ex("My InnerException message"); }
%}
+
+%{
+#if defined(_MSC_VER)
+ #pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
+#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic pop
+#endif
+%}
diff --git a/Examples/test-suite/default_args.i b/Examples/test-suite/default_args.i
index 02d860765..39b499cf4 100644
--- a/Examples/test-suite/default_args.i
+++ b/Examples/test-suite/default_args.i
@@ -6,6 +6,10 @@
#if defined(_MSC_VER)
#pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated in C++11
+#endif
%}
%include <std_string.i>
@@ -305,3 +309,11 @@ struct CDA {
};
%}
+%{
+#if defined(_MSC_VER)
+ #pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
+#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic pop
+#endif
+%}
diff --git a/Examples/test-suite/director_exception.i b/Examples/test-suite/director_exception.i
index abe23b381..0f87fb4ba 100644
--- a/Examples/test-suite/director_exception.i
+++ b/Examples/test-suite/director_exception.i
@@ -7,6 +7,10 @@
#if defined(_MSC_VER)
#pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated in C++11
+#endif
#include <string>
diff --git a/Examples/test-suite/exception_order.i b/Examples/test-suite/exception_order.i
index 02674fef9..194394332 100644
--- a/Examples/test-suite/exception_order.i
+++ b/Examples/test-suite/exception_order.i
@@ -16,6 +16,10 @@
#if defined(_MSC_VER)
#pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated in C++11
+#endif
%}
/*
@@ -146,3 +150,12 @@ bool is_python_builtin() { return false; }
%template(ET_i) ET<int>;
%template(ET_d) ET<double>;
+
+%{
+#if defined(_MSC_VER)
+ #pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
+#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic pop
+#endif
+%}
diff --git a/Examples/test-suite/extern_throws.i b/Examples/test-suite/extern_throws.i
index eab26244e..81eeb64c2 100644
--- a/Examples/test-suite/extern_throws.i
+++ b/Examples/test-suite/extern_throws.i
@@ -4,6 +4,10 @@
#if defined(_MSC_VER)
#pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated in C++11
+#endif
%}
%inline %{
@@ -16,3 +20,11 @@ extern int get() throw(std::exception);
int get() throw(std::exception) { return 0; }
%}
+%{
+#if defined(_MSC_VER)
+ #pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
+#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic pop
+#endif
+%}
diff --git a/Examples/test-suite/java_director_exception_feature.i b/Examples/test-suite/java_director_exception_feature.i
index d6f1e3f55..a0b3b7261 100644
--- a/Examples/test-suite/java_director_exception_feature.i
+++ b/Examples/test-suite/java_director_exception_feature.i
@@ -8,14 +8,17 @@
#if defined(_MSC_VER)
#pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
-
-#include <string>
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated in C++11
+#endif
%}
%include <std_string.i>
// DEFINE exceptions in header section using std::runtime_error
%{
+ #include <string>
#include <exception>
#include <iostream>
diff --git a/Examples/test-suite/java_director_exception_feature_nspace.i b/Examples/test-suite/java_director_exception_feature_nspace.i
index 264c2a938..3111538fc 100644
--- a/Examples/test-suite/java_director_exception_feature_nspace.i
+++ b/Examples/test-suite/java_director_exception_feature_nspace.i
@@ -15,14 +15,17 @@
#if defined(_MSC_VER)
#pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
-
-#include <string>
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated in C++11
+#endif
%}
%include <std_string.i>
// DEFINE exceptions in header section using std::runtime_error
%{
+ #include <string>
#include <exception>
#include <iostream>
diff --git a/Examples/test-suite/java_throws.i b/Examples/test-suite/java_throws.i
index 48a0eeabc..c628a45e6 100644
--- a/Examples/test-suite/java_throws.i
+++ b/Examples/test-suite/java_throws.i
@@ -42,10 +42,19 @@ short full_of_exceptions(int num) {
#if defined(_MSC_VER)
#pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated in C++11
+#endif
+
bool throw_spec_function(int value) throw (int) { throw (int)0; }
+
#if defined(_MSC_VER)
#pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic pop
+#endif
%}
%catches(int) catches_function(int value);
diff --git a/Examples/test-suite/li_std_except.i b/Examples/test-suite/li_std_except.i
index b79d36bc1..8c96a11f8 100644
--- a/Examples/test-suite/li_std_except.i
+++ b/Examples/test-suite/li_std_except.i
@@ -6,6 +6,10 @@
#if defined(_MSC_VER)
#pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated in C++11
+#endif
%}
@@ -38,3 +42,13 @@
void throw_underflow_error() throw(std::underflow_error) { throw std::underflow_error("oops"); }
};
%}
+
+
+%{
+#if defined(_MSC_VER)
+ #pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
+#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic pop
+#endif
+%}
diff --git a/Examples/test-suite/li_std_except_as_class.i b/Examples/test-suite/li_std_except_as_class.i
index 01ed1f07c..1b5dd6082 100644
--- a/Examples/test-suite/li_std_except_as_class.i
+++ b/Examples/test-suite/li_std_except_as_class.i
@@ -9,6 +9,10 @@
#if defined(_MSC_VER)
#pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated in C++11
+#endif
%}
%{
@@ -31,3 +35,12 @@ bool is_python_builtin() { return true; }
bool is_python_builtin() { return false; }
#endif
%}
+
+%{
+#if defined(_MSC_VER)
+ #pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
+#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic pop
+#endif
+%}
diff --git a/Examples/test-suite/li_std_string.i b/Examples/test-suite/li_std_string.i
index a1a55ed85..15042c464 100644
--- a/Examples/test-suite/li_std_string.i
+++ b/Examples/test-suite/li_std_string.i
@@ -6,6 +6,16 @@
%apply std::string& INOUT { std::string &inout }
#endif
+%{
+#if defined(_MSC_VER)
+ #pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
+#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated in C++11
+#endif
+%}
+
%inline %{
@@ -49,10 +59,6 @@ void test_reference_inout(std::string &inout) {
inout += inout;
}
-#if defined(_MSC_VER)
- #pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
-#endif
-
void test_throw() throw(std::string){
static std::string x = "test_throw message";
throw x;
@@ -154,6 +160,13 @@ public:
const char *get_null(const char *a) {
return a == 0 ? a : "non-null";
}
+%}
-
+%{
+#if defined(_MSC_VER)
+ #pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
+#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic pop
+#endif
%}
diff --git a/Examples/test-suite/li_std_wstring.i b/Examples/test-suite/li_std_wstring.i
index 80f860338..3c2d6f183 100644
--- a/Examples/test-suite/li_std_wstring.i
+++ b/Examples/test-suite/li_std_wstring.i
@@ -81,6 +81,10 @@ std::wstring& test_reference_out() {
#if defined(_MSC_VER)
#pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated in C++11
+#endif
void test_throw() throw(std::wstring){
static std::wstring x = L"x";
@@ -91,6 +95,9 @@ void test_throw() throw(std::wstring){
#if defined(_MSC_VER)
#pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic pop
+#endif
#ifdef SWIGPYTHON_BUILTIN
bool is_python_builtin() { return true; }
diff --git a/Examples/test-suite/primitive_types.i b/Examples/test-suite/primitive_types.i
index b9b973a2b..c68b1fc8f 100644
--- a/Examples/test-suite/primitive_types.i
+++ b/Examples/test-suite/primitive_types.i
@@ -11,6 +11,10 @@
#if defined(_MSC_VER)
#pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated in C++11
+#endif
%}
// Ruby constant names
diff --git a/Examples/test-suite/python_builtin.i b/Examples/test-suite/python_builtin.i
index d4e245dc4..21cbda3e9 100644
--- a/Examples/test-suite/python_builtin.i
+++ b/Examples/test-suite/python_builtin.i
@@ -6,6 +6,10 @@
#if defined(_MSC_VER)
#pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated in C++11
+#endif
%}
%inline %{
@@ -223,3 +227,12 @@ void Dealloc2Destroyer(PyObject *v) {
}
};
%}
+
+%{
+#if defined(_MSC_VER)
+ #pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
+#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic pop
+#endif
+%}
diff --git a/Examples/test-suite/threads_exception.i b/Examples/test-suite/threads_exception.i
index caa79c78e..a9865da3c 100644
--- a/Examples/test-suite/threads_exception.i
+++ b/Examples/test-suite/threads_exception.i
@@ -14,6 +14,10 @@ struct A {};
#if defined(_MSC_VER)
#pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated in C++11
+#endif
class Exc {
public:
@@ -58,4 +62,11 @@ bool is_python_builtin() { return true; }
#else
bool is_python_builtin() { return false; }
#endif
+
+#if defined(_MSC_VER)
+ #pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
+#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic pop
+#endif
%}
diff --git a/Examples/test-suite/throw_exception.i b/Examples/test-suite/throw_exception.i
index 396c633a6..777e55b9e 100644
--- a/Examples/test-suite/throw_exception.i
+++ b/Examples/test-suite/throw_exception.i
@@ -4,6 +4,10 @@
#if defined(_MSC_VER)
#pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated in C++11
+#endif
%}
%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Namespace::enum1;
@@ -77,3 +81,11 @@ public:
%}
+%{
+#if defined(_MSC_VER)
+ #pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
+#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic pop
+#endif
+%}
diff --git a/Examples/test-suite/using_pointers.i b/Examples/test-suite/using_pointers.i
index b2d6abe4d..569acce25 100644
--- a/Examples/test-suite/using_pointers.i
+++ b/Examples/test-suite/using_pointers.i
@@ -8,6 +8,10 @@
#if defined(_MSC_VER)
#pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated in C++11
+#endif
%}
%inline %{
@@ -34,3 +38,11 @@
%}
+%{
+#if defined(_MSC_VER)
+ #pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
+#endif
+#if __GNUC__ >= 7
+ #pragma GCC diagnostic pop
+#endif
+%}