diff --git a/Examples/test-suite/li_std_except.i b/Examples/test-suite/li_std_except.i index e266ce624..fc886dca7 100644 --- a/Examples/test-suite/li_std_except.i +++ b/Examples/test-suite/li_std_except.i @@ -2,6 +2,12 @@ %include +%{ +#if defined(_MSC_VER) + #pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow) +#endif +%} + %inline %{ struct E1 : public std::exception diff --git a/Examples/test-suite/li_std_string.i b/Examples/test-suite/li_std_string.i index 32e9f95c8..a4b8c3641 100644 --- a/Examples/test-suite/li_std_string.i +++ b/Examples/test-suite/li_std_string.i @@ -35,6 +35,10 @@ std::string& test_reference_out() { return x; } +#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; @@ -53,6 +57,10 @@ void test_const_pointer_throw() throw(const std::string *) { throw new std::string("foo"); } +#if defined(_MSC_VER) + #pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow) +#endif + %} %apply const std::string& { std::string *GlobalString2, diff --git a/Examples/test-suite/python/li_std_string.i b/Examples/test-suite/python/li_std_string.i index 1f769bb20..4eefa7a1a 100644 --- a/Examples/test-suite/python/li_std_string.i +++ b/Examples/test-suite/python/li_std_string.i @@ -65,12 +65,20 @@ std::string& test_reference_out() { return x; } +#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 = "x"; throw x; } +#if defined(_MSC_VER) + #pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow) +#endif + std::basic_string test_value_basic1(std::basic_string x) { return x;