diff options
Diffstat (limited to 'Examples/test-suite/nested_class.i')
-rw-r--r-- | Examples/test-suite/nested_class.i | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Examples/test-suite/nested_class.i b/Examples/test-suite/nested_class.i index b10c33949..4815fc834 100644 --- a/Examples/test-suite/nested_class.i +++ b/Examples/test-suite/nested_class.i @@ -55,6 +55,11 @@ #pragma GCC diagnostic ignored "-Wpedantic" #endif +#if defined(__clang__) +// Suppress: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] +#pragma clang diagnostic ignored "-Wnon-c-typedef-for-linkage" +#endif + namespace bar { int foo() { return 0; } } @@ -133,8 +138,13 @@ struct Outer { Integer x; } InnerClass4Typedef; -#ifdef _MSC_VER - int Outer::foo(){ return 1; } // should correctly ignore qualification here (#508) +#ifdef SWIG + // SWIG should ignore the redundant qualification here (#508)... + int Outer::foo(){ return 1; } +#else + // ..but that redundant qualification is actually invalid and many compilers + // now reject it with an error, so feed a valid version to the compiler. + int foo(){ return 1; } #endif typedef struct { @@ -201,7 +211,7 @@ struct Outer { Integer xx; } MultipleInstanceAnonDerived1, MultipleInstanceAnonDerived2, *MultipleInstanceAnonDerived3, MultipleInstanceAnonDerived4[2]; -#if defined(__GNUC__) || defined(_MSC_VER) || defined(SWIG) +#if (defined(__GNUC__) && __GNUC__ < 12) || defined(_MSC_VER) || defined(SWIG) /* some compilers do not accept these */ struct : public InnerMultiple { Integer xx; |