From aee3c62957ecdae385728c5cd49c7db967c5b82f Mon Sep 17 00:00:00 2001 From: Gennaro Prota Date: Wed, 17 Dec 2025 16:05:21 +0100 Subject: [PATCH] Apply the workaround in the previous commit to Clang 3.7 and 9-19, too Reason: They have the same issue as GCC 9. --- include/boost/static_string/config.hpp | 5 ++++- test/constexpr_tests.hpp | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/boost/static_string/config.hpp b/include/boost/static_string/config.hpp index c9570cb..e7c155a 100644 --- a/include/boost/static_string/config.hpp +++ b/include/boost/static_string/config.hpp @@ -289,7 +289,10 @@ using basic_string_view = // GCC 9 incorrectly rejects the pointer equality comparison in // ptr_in_range() in constant expressions. GCC 10 and later handle // it correctly. -#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ == 9) +// +// Clang 3.7 and 9-19 have the same issue. +#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ == 9)) \ + || (defined(__clang__) && ((__clang_major__ == 3 && __clang_minor__ == 7) || ((__clang_major__ >= 9) && (__clang_major__ <= 19)))) #define BOOST_STATIC_STRING_CONSTEXPR_PTR_CMP_BROKEN #endif diff --git a/test/constexpr_tests.hpp b/test/constexpr_tests.hpp index f541183..536a463 100644 --- a/test/constexpr_tests.hpp +++ b/test/constexpr_tests.hpp @@ -617,7 +617,8 @@ testConstantEvaluation() a.replace(a.begin(), a.end(), a.begin(), a.end()); a.replace(a.begin(), a.end(), {'a'}); -#ifdef BOOST_STATIC_STRING_IS_CONST_EVAL +#if defined(BOOST_STATIC_STRING_IS_CONST_EVAL) \ + && !defined(BOOST_STATIC_STRING_CONSTEXPR_PTR_CMP_BROKEN) a.clear(); a.replace(a.begin(), a.end(), "a"); a.replace(a.begin(), a.end(), "a", 1);