From 688cf84251898a79a122e0180ea02cc50df64f8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 12 Oct 2023 13:01:31 +0200 Subject: [PATCH] Text: work around clang-cl choking on two __declspec attributes. This class won't print the deprecation warning in that case. I'm a bit disappointed that the Clang changelogs are always so vague, there's often never a possibility to figure out which version a particular bug was fixed in apart from testing each and every. --- src/Magnum/Text/AbstractFont.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Text/AbstractFont.h b/src/Magnum/Text/AbstractFont.h index 847b31664..99ca08b34 100644 --- a/src/Magnum/Text/AbstractFont.h +++ b/src/Magnum/Text/AbstractFont.h @@ -696,7 +696,19 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { @m_deprecated_since_latest Use @ref AbstractShaper returned from @ref AbstractFont::createShaper() instead. */ -class MAGNUM_TEXT_EXPORT CORRADE_DEPRECATED("use AbstractShaper instead") AbstractLayouter { +class MAGNUM_TEXT_EXPORT + /* Clang-cl 12, included in MSVC 2019, chokes on two __declspec attributes + being specified here. Clang-cl 16, included in MSVC 2022, doesn't, but I + couldn't find any relevant changelog entry in the in-between versions to + know which version this was actually fixed in, except for these: + https://releases.llvm.org/16.0.0/tools/clang/docs/ReleaseNotes.html#bug-fixes-to-attribute-support + Also probably not limited to just clang-cl, but also regular Clang + within MSVC, and a MinGW Clang as well, so taking the safe path and + excluding all Clang versions below 16 on Windows. */ + #if !defined(CORRADE_TARGET_WINDOWS) || !defined(CORRADE_TARGET_CLANG) || __clang_major__ >= 16 + CORRADE_DEPRECATED("use AbstractShaper instead") + #endif +AbstractLayouter { public: /** @brief Copying is not allowed */ AbstractLayouter(const AbstractLayouter&) = delete;