diff --git a/src/Magnum/Math/Angle.h b/src/Magnum/Math/Angle.h index cc110413a..2e555afa2 100644 --- a/src/Magnum/Math/Angle.h +++ b/src/Magnum/Math/Angle.h @@ -164,10 +164,11 @@ namespace Literals { load-bearing in any other contexts. Clang 17+ adds an off-by-default warning for this; GCC 4.8 however *requires* the space there, so until GCC 4.8 support is dropped, we suppress this warning instead of removing the - space. */ -#if defined(CORRADE_TARGET_CLANG) && __clang_major__ >= 17 -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-literal-operator" + space. GCC 15 now has the same warning but it's enabled by default on + -std=c++23. */ +#if (defined(CORRADE_TARGET_CLANG) && __clang_major__ >= 17) || (defined(CORRADE_TARGET_GCC) && !defined(CORRADE_TARGET_CLANG) && __GNUC__ >= 15) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-literal-operator" #endif /** @relatesalso Magnum::Math::Deg @brief Double-precision degree value literal @@ -192,8 +193,8 @@ Example usage: @m_keywords{_degf degf} */ constexpr Deg operator"" _degf(long double value) { return Deg(Float(value)); } -#if defined(CORRADE_TARGET_CLANG) && __clang_major__ >= 17 -#pragma clang diagnostic pop +#if (defined(CORRADE_TARGET_CLANG) && __clang_major__ >= 17) || (defined(CORRADE_TARGET_GCC) && !defined(CORRADE_TARGET_CLANG) && __GNUC__ >= 15) +#pragma GCC diagnostic pop #endif }} @@ -267,10 +268,11 @@ namespace Literals { load-bearing in any other contexts. Clang 17+ adds an off-by-default warning for this; GCC 4.8 however *requires* the space there, so until GCC 4.8 support is dropped, we suppress this warning instead of removing the - space. */ -#if defined(CORRADE_TARGET_CLANG) && __clang_major__ >= 17 -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-literal-operator" + space. GCC 15 now has the same warning but it's enabled by default on + -std=c++23. */ +#if (defined(CORRADE_TARGET_CLANG) && __clang_major__ >= 17) || (defined(CORRADE_TARGET_GCC) && !defined(CORRADE_TARGET_CLANG) && __GNUC__ >= 15) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-literal-operator" #endif /** @relatesalso Magnum::Math::Rad @brief Double-precision radian value literal @@ -289,8 +291,8 @@ See @link operator""_degf() @endlink for more information. @m_keywords{_radf radf} */ constexpr Rad operator"" _radf(long double value) { return Rad(Float(value)); } -#if defined(CORRADE_TARGET_CLANG) && __clang_major__ >= 17 -#pragma clang diagnostic pop +#if (defined(CORRADE_TARGET_CLANG) && __clang_major__ >= 17) || (defined(CORRADE_TARGET_GCC) && !defined(CORRADE_TARGET_CLANG) && __GNUC__ >= 15) +#pragma GCC diagnostic pop #endif }} diff --git a/src/Magnum/Math/Color.h b/src/Magnum/Math/Color.h index 2328a6865..3bfece282 100644 --- a/src/Magnum/Math/Color.h +++ b/src/Magnum/Math/Color.h @@ -1502,10 +1502,11 @@ namespace Literals { load-bearing in any other contexts. Clang 17+ adds an off-by-default warning for this; GCC 4.8 however *requires* the space there, so until GCC 4.8 support is dropped, we suppress this warning instead of removing the - space. */ -#if defined(CORRADE_TARGET_CLANG) && __clang_major__ >= 17 -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-literal-operator" + space. GCC 15 now has the same warning but it's enabled by default on + -std=c++23. */ +#if (defined(CORRADE_TARGET_CLANG) && __clang_major__ >= 17) || (defined(CORRADE_TARGET_GCC) && !defined(CORRADE_TARGET_CLANG) && __GNUC__ >= 15) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-literal-operator" #endif /** @relatesalso Magnum::Math::Color3 @brief 8bit-per-channel linear RGB literal @@ -1867,8 +1868,8 @@ operator"" _srgbah() { return Color4{Color4::fromSrgbAlpha(Implementation::color4Literal, 1, sizeof...(chars), chars...>())}; } #endif -#if defined(CORRADE_TARGET_CLANG) && __clang_major__ >= 17 -#pragma clang diagnostic pop +#if (defined(CORRADE_TARGET_CLANG) && __clang_major__ >= 17) || (defined(CORRADE_TARGET_GCC) && !defined(CORRADE_TARGET_CLANG) && __GNUC__ >= 15) +#pragma GCC diagnostic pop #endif }} diff --git a/src/Magnum/Math/Half.h b/src/Magnum/Math/Half.h index 89a3ffc68..5feff03cc 100644 --- a/src/Magnum/Math/Half.h +++ b/src/Magnum/Math/Half.h @@ -192,10 +192,11 @@ namespace Literals { load-bearing in any other contexts. Clang 17+ adds an off-by-default warning for this; GCC 4.8 however *requires* the space there, so until GCC 4.8 support is dropped, we suppress this warning instead of removing the - space. */ -#if defined(CORRADE_TARGET_CLANG) && __clang_major__ >= 17 -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-literal-operator" + space. GCC 15 now has the same warning but it's enabled by default on + -std=c++23. */ +#if (defined(CORRADE_TARGET_CLANG) && __clang_major__ >= 17) || (defined(CORRADE_TARGET_GCC) && !defined(CORRADE_TARGET_CLANG) && __GNUC__ >= 15) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-literal-operator" #endif /** @relatesalso Magnum::Math::Half @brief Half-float literal @@ -203,8 +204,8 @@ namespace Literals { See @ref Half for more information. */ inline Half operator"" _h(long double value) { return Half(Float(value)); } -#if defined(CORRADE_TARGET_CLANG) && __clang_major__ >= 17 -#pragma clang diagnostic pop +#if (defined(CORRADE_TARGET_CLANG) && __clang_major__ >= 17) || (defined(CORRADE_TARGET_GCC) && !defined(CORRADE_TARGET_CLANG) && __GNUC__ >= 15) +#pragma GCC diagnostic pop #endif }} diff --git a/src/Magnum/Math/Time.h b/src/Magnum/Math/Time.h index b71a34ff1..8844be99e 100644 --- a/src/Magnum/Math/Time.h +++ b/src/Magnum/Math/Time.h @@ -297,10 +297,11 @@ namespace Literals { load-bearing in any other contexts. Clang 17+ adds an off-by-default warning for this; GCC 4.8 however *requires* the space there, so until GCC 4.8 support is dropped, we suppress this warning instead of removing the - space. */ -#if defined(CORRADE_TARGET_CLANG) && __clang_major__ >= 17 -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-literal-operator" + space. GCC 15 now has the same warning but it's enabled by default on + -std=c++23. */ +#if (defined(CORRADE_TARGET_CLANG) && __clang_major__ >= 17) || (defined(CORRADE_TARGET_GCC) && !defined(CORRADE_TARGET_CLANG) && __GNUC__ >= 15) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-literal-operator" #endif /** @relatesalso Magnum::Math::Nanoseconds @brief Nanosecond value literal @@ -388,8 +389,8 @@ precision on a range of roughly ±2 hours. For example: constexpr Nanoseconds operator"" _sec(long double value) { return Nanoseconds{Long(value*1000000000.0l)}; } -#if defined(CORRADE_TARGET_CLANG) && __clang_major__ >= 17 -#pragma clang diagnostic pop +#if (defined(CORRADE_TARGET_CLANG) && __clang_major__ >= 17) || (defined(CORRADE_TARGET_GCC) && !defined(CORRADE_TARGET_CLANG) && __GNUC__ >= 15) +#pragma GCC diagnostic pop #endif }}