Skip to content

Commit 6d2e7c9

Browse files
committed
Apply the workaround in the previous commit to Clang 3.7 and 9-19, too
Reason: They have the same issue as GCC 9.
1 parent 4c312fc commit 6d2e7c9

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

include/boost/static_string/config.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,10 @@ using basic_string_view =
289289
// GCC 9 incorrectly rejects the pointer equality comparison in
290290
// ptr_in_range() in constant expressions. GCC 10 and later handle
291291
// it correctly.
292-
#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ == 9)
292+
//
293+
// Clang 3.7 and 9-19 have the same issue.
294+
#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ == 9)) \
295+
|| (defined(__clang__) && ((__clang_major__ == 3 && __clang_minor__ == 7) || ((__clang_major__ >= 9) && (__clang_major__ <= 19))))
293296
#define BOOST_STATIC_STRING_CONSTEXPR_PTR_CMP_BROKEN
294297
#endif
295298

test/constexpr_tests.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,8 @@ testConstantEvaluation()
617617
a.replace(a.begin(), a.end(), a.begin(), a.end());
618618
a.replace(a.begin(), a.end(), {'a'});
619619

620-
#ifdef BOOST_STATIC_STRING_IS_CONST_EVAL
620+
#if defined(BOOST_STATIC_STRING_IS_CONST_EVAL) \
621+
&& !defined(BOOST_STATIC_STRING_CONSTEXPR_PTR_CMP_BROKEN)
621622
a.clear();
622623
a.replace(a.begin(), a.end(), "a");
623624
a.replace(a.begin(), a.end(), "a", 1);

0 commit comments

Comments
 (0)