Suppress clang warnings in test-suite

Suppresses -Wfinal-dtor-non-final-class and -Wnon-c-typedef-for-linkage
observed with clang 17.
This commit is contained in:
William S Fulton 2023-08-09 19:43:13 +01:00
parent a24465c3cb
commit 0d203fc1df
3 changed files with 19 additions and 0 deletions

View File

@ -9,6 +9,13 @@
%warnfilter(SWIGWARN_LANG_DIRECTOR_FINAL) BaseFinalDestructor::~BaseFinalDestructor;
%warnfilter(SWIGWARN_LANG_DIRECTOR_FINAL) BaseFinalDestructor2::~BaseFinalDestructor2;
%{
#if defined(__clang__)
// Suppress: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class]
#pragma clang diagnostic ignored "-Wfinal-dtor-non-final-class"
#endif
%}
%inline %{
struct Base {
virtual void basemeth() final {}

View File

@ -6,6 +6,13 @@
%warnfilter(SWIGWARN_PARSE_KEYWORD) final; // 'final' is a java keyword, renaming to '_final'
%warnfilter(SWIGWARN_PARSE_KEYWORD) override; // 'override' is a C# keyword, renaming to '_override'
%{
#if defined(__clang__)
// Suppress: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class]
#pragma clang diagnostic ignored "-Wfinal-dtor-non-final-class"
#endif
%}
// throw is invalid in C++17 and later, only SWIG to use it
#define TESTCASE_THROW1(T1) throw(T1)
%{

View File

@ -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; }
}