From 145ef63834588631987b5ee4d5984e0a63b0d634 Mon Sep 17 00:00:00 2001 From: Jim Porter Date: Wed, 1 May 2024 20:35:15 -0700 Subject: [PATCH] Ignore deprecation warnings for codecvt and iostreams --- .github/workflows/build.yml | 8 +++----- include/mettle/output/string.hpp | 7 ++++++- src/libmettle/driver.cpp | 12 ++++++++++++ src/mettle/posix/run_test_file.cpp | 10 ++++++++++ src/mettle/windows/run_test_file.cpp | 10 ++++++++++ 5 files changed, 41 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5f41dca..7b0bf76 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,8 +57,7 @@ jobs: boost-version: '1.80.0'} # macOS builds - # FIXME: Remove -Wno-deprecated flag. - - {os: macos-latest, compiler: clang, flags: '-Wno-deprecated'} + - {os: macos-latest, compiler: clang} # Boost 1.58 builds # (Test 1.58 specifically because it has very strict rules for @@ -73,9 +72,8 @@ jobs: flags: '-DNDEBUG', extra-desc: 'NDEBUG'} - {os: windows-latest, compiler: msvc, flags: '/DNDEBUG', version: '14.3', boost-version: '1.80.0', extra-desc: 'NDEBUG'} - # FIXME: Remove -Wno-deprecated flag. - - {os: macos-latest, compiler: clang, - flags: '-Wno-deprecated -DNDEBUG', extra-desc: 'NDEBUG'} + - {os: macos-latest, compiler: clang, flags: '-DNDEBUG', + extra-desc: 'NDEBUG'} # C++20 builds - {os: ubuntu-latest, compiler: gcc, version: '13', diff --git a/include/mettle/output/string.hpp b/include/mettle/output/string.hpp index 03eecff..6bff0f8 100644 --- a/include/mettle/output/string.hpp +++ b/include/mettle/output/string.hpp @@ -80,10 +80,13 @@ namespace mettle { return s; } -// Ignore warnings from MSVC about deprecated +// Ignore warnings about deprecated #if defined(_MSC_VER) && !defined(__clang__) # pragma warning(push) # pragma warning(disable:4996) +#elif defined(__GNUG__) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wdeprecated" #endif inline std::string @@ -126,6 +129,8 @@ namespace mettle { #if defined(_MSC_VER) && !defined(__clang__) # pragma warning(pop) +#elif defined(__GNUG__) +# pragma GCC diagnostic pop #endif } diff --git a/src/libmettle/driver.cpp b/src/libmettle/driver.cpp index 675ee2d..1f45d43 100644 --- a/src/libmettle/driver.cpp +++ b/src/libmettle/driver.cpp @@ -4,8 +4,20 @@ #include #define NOMINMAX + +// Ignore warnings about deprecated implicit copy constructor. +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wdeprecated-copy" +#endif + #include #include + +#if defined(__clang__) +# pragma clang diagnostic pop +#endif + #include #include diff --git a/src/mettle/posix/run_test_file.cpp b/src/mettle/posix/run_test_file.cpp index a1681e8..f1fe1a3 100644 --- a/src/mettle/posix/run_test_file.cpp +++ b/src/mettle/posix/run_test_file.cpp @@ -8,9 +8,19 @@ #include #include +// Ignore warnings about deprecated implicit copy constructor. +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wdeprecated-copy" +#endif + #include #include +#if defined(__clang__) +# pragma clang diagnostic pop +#endif + #include #include #include diff --git a/src/mettle/windows/run_test_file.cpp b/src/mettle/windows/run_test_file.cpp index ef635c4..514c883 100644 --- a/src/mettle/windows/run_test_file.cpp +++ b/src/mettle/windows/run_test_file.cpp @@ -3,9 +3,19 @@ #include #include +// Ignore warnings about deprecated implicit copy constructor. +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wdeprecated-copy" +#endif + #include #include +#if defined(__clang__) +# pragma clang diagnostic pop +#endif + #include #include