From 862ae78d4ba2932ec821c1a7b2ffffab37f48dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 16 Jul 2026 01:16:55 +0200 Subject: [PATCH] Trade: skip these deprecation macros to silence Emscripten Clang 23. It warns inside for some reason. Happens on Emscripten 5.0.2 all the way until latest 6.0.3, didn't happen on 5.0.1, and the random Clang revision it's using isn't even released as a version 23 yet so I can't tell if this is specific to Emscripten's filesystem layout or is something that'll happen when building natively as well. So just omit those few for now. --- src/Magnum/Trade/MaterialData.h | 11 ++++++++++- src/Magnum/Trade/ObjectData2D.h | 11 ++++++++++- src/Magnum/Trade/ObjectData3D.h | 11 ++++++++++- src/Magnum/Trade/PhongMaterialData.h | 11 ++++++++++- 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/src/Magnum/Trade/MaterialData.h b/src/Magnum/Trade/MaterialData.h index 3fe41fdcd..d765d0d70 100644 --- a/src/Magnum/Trade/MaterialData.h +++ b/src/Magnum/Trade/MaterialData.h @@ -2031,7 +2031,16 @@ class MAGNUM_TRADE_EXPORT MaterialData { * This enum is further extended in subclasses. * @see @ref Flags, @ref flags() */ - enum class CORRADE_DEPRECATED_ENUM("use hasAttribute() etc. instead") Flag: UnsignedInt { + enum class + #if !defined(CORRADE_TARGET_EMSCRIPTEN) || __clang_major__ < 23 + /* Clang 23 in Emscripten 5.0.2+ issues a deprecation warning inside + due to std::underlying_type used by EnumSet on this + enum. Not sure if it's because the STL headers are in ~/.cache or if + it's a general annoyance that'll happen with real Clang 23 as well, + for now just skipping the deprecation annotation to silence it. */ + CORRADE_DEPRECATED_ENUM("use hasAttribute() etc. instead") + #endif + Flag: UnsignedInt { /** * The material is double-sided. Back faces should not be culled * away but rendered as well, with normals flipped for correct diff --git a/src/Magnum/Trade/ObjectData2D.h b/src/Magnum/Trade/ObjectData2D.h index e5d607faf..217f6d262 100644 --- a/src/Magnum/Trade/ObjectData2D.h +++ b/src/Magnum/Trade/ObjectData2D.h @@ -74,7 +74,16 @@ enum class CORRADE_DEPRECATED_ENUM("use SceneData instead") ObjectInstanceType2D @see @ref ObjectFlags2D, @ref ObjectData2D::flags() */ -enum class CORRADE_DEPRECATED_ENUM("use SceneData instead") ObjectFlag2D: UnsignedByte { +enum class +#if !defined(CORRADE_TARGET_EMSCRIPTEN) || __clang_major__ < 23 +/* Clang 23 in Emscripten 5.0.2+ issues a deprecation warning inside + due to std::underlying_type used by EnumSet on this enum. Not + sure if it's because the STL headers are in ~/.cache or if it's a general + annoyance that'll happen with real Clang 23 as well, for now just skipping + the deprecation annotation to silence it. */ +CORRADE_DEPRECATED_ENUM("use SceneData instead") +#endif +ObjectFlag2D: UnsignedByte { /** * The object provides separate translation / rotation / scaling * properties. The @ref ObjectData2D::transformation() matrix returns them diff --git a/src/Magnum/Trade/ObjectData3D.h b/src/Magnum/Trade/ObjectData3D.h index c67b51091..fba48ab5d 100644 --- a/src/Magnum/Trade/ObjectData3D.h +++ b/src/Magnum/Trade/ObjectData3D.h @@ -75,7 +75,16 @@ enum class CORRADE_DEPRECATED_ENUM("use SceneData instead") ObjectInstanceType3D @see @ref ObjectFlags3D, @ref ObjectData3D::flags() */ -enum class CORRADE_DEPRECATED_ENUM("use SceneData instead") ObjectFlag3D: UnsignedByte { +enum class +#if !defined(CORRADE_TARGET_EMSCRIPTEN) || __clang_major__ < 23 +/* Clang 23 in Emscripten 5.0.2+ issues a deprecation warning inside + due to std::underlying_type used by EnumSet on this enum. Not + sure if it's because the STL headers are in ~/.cache or if it's a general + annoyance that'll happen with real Clang 23 as well, for now just skipping + the deprecation annotation to silence it. */ +CORRADE_DEPRECATED_ENUM("use SceneData instead") +#endif +ObjectFlag3D: UnsignedByte { /** * The object provides separate translation / rotation / scaling * properties. The @ref ObjectData3D::transformation() matrix returns them diff --git a/src/Magnum/Trade/PhongMaterialData.h b/src/Magnum/Trade/PhongMaterialData.h index 7c9f92d8f..adcb53639 100644 --- a/src/Magnum/Trade/PhongMaterialData.h +++ b/src/Magnum/Trade/PhongMaterialData.h @@ -58,7 +58,16 @@ class MAGNUM_TRADE_EXPORT PhongMaterialData: public MaterialData { * A superset of @ref MaterialData::Flag. * @see @ref Flags, @ref flags() */ - enum class CORRADE_DEPRECATED_ENUM("use hasAttribute() etc. instead") Flag: UnsignedInt { + enum class + #if !defined(CORRADE_TARGET_EMSCRIPTEN) || __clang_major__ < 23 + /* Clang 23 in Emscripten 5.0.2+ issues a deprecation warning inside + due to std::underlying_type used by EnumSet on this + enum. Not sure if it's because the STL headers are in ~/.cache or if + it's a general annoyance that'll happen with real Clang 23 as well, + for now just skipping the deprecation annotation to silence it. */ + CORRADE_DEPRECATED_ENUM("use hasAttribute() etc. instead") + #endif + Flag: UnsignedInt { /** @copydoc MaterialData::Flag::DoubleSided */ DoubleSided = 1 << 0,