diff --git a/Examples/test-suite/director_exception.i b/Examples/test-suite/director_exception.i index 78bd715cd..8c2ccc61b 100644 --- a/Examples/test-suite/director_exception.i +++ b/Examples/test-suite/director_exception.i @@ -2,18 +2,6 @@ %warnfilter(SWIGWARN_TYPEMAP_DIRECTOROUT_PTR) return_const_char_star; -%{ -// throw is deprecated in C++11 and invalid in C++17 and later -#if defined(__cplusplus) && __cplusplus >= 201103L -#define throw(TYPES...) -#else -#define throw(TYPES...) throw(TYPES) -#if defined(_MSC_VER) - #pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow) -#endif -#endif -%} - %{ #include @@ -127,6 +115,18 @@ Foo *launder(Foo *f) { %feature("director") Bar; %feature("director") ReturnAllTypes; +%{ +// throw is deprecated in C++11 and invalid in C++17 and later +#if defined(__cplusplus) && __cplusplus >= 201103L +#define throw(TYPES...) +#else +#define throw(TYPES...) throw(TYPES) +#if defined(_MSC_VER) + #pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow) +#endif +#endif +%} + %inline %{ struct Exception1 {