Apply the workaround in the previous commit to Clang 3.7 and 9-19, too

Reason: They have the same issue as GCC 9.
This commit is contained in:
Gennaro Prota
2025-12-17 16:05:21 +01:00
parent 8de075835b
commit 739060f809
2 changed files with 6 additions and 2 deletions

View File

@@ -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

View File

@@ -618,7 +618,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);