From 3148e4877cebf60d0bfa80bc2b18c6658339c6be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Sat, 9 May 2026 23:37:16 +0200 Subject: [PATCH] Fix BOOST_CONTAINER_UNROLL for Clang --- include/boost/container/detail/workaround.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/boost/container/detail/workaround.hpp b/include/boost/container/detail/workaround.hpp index e67d6a3..ef23a04 100644 --- a/include/boost/container/detail/workaround.hpp +++ b/include/boost/container/detail/workaround.hpp @@ -249,8 +249,12 @@ namespace boost { #define BOOST_CONTAINER_NOVTABLE #endif -#if defined(BOOST_CLANG) && BOOST_CLANG >= 30600 || \ - defined(BOOST_GCC) && BOOST_GCC >= 150000 +#if (defined(BOOST_CLANG) && BOOST_CLANG_VERSION >= 30600) + + #define BOOST_CONTAINER_UNROLL_PRAGMA(x) _Pragma(#x) + #define BOOST_CONTAINER_UNROLL(n) BOOST_CONTAINER_UNROLL_PRAGMA(unroll n) + +#elif (defined(BOOST_GCC) && BOOST_GCC_VERSION >= 150000) // GCC < 15 emits an unsuppressible "ignoring loop annotation" warning // when the optimizer decides it cannot unroll a loop (complex iterators, // unknown trip count, etc.). This was fixed in GCC 15.