Avoiding __builtin_strlen (#4429)

This commit is contained in:
Barry Revzin
2025-04-27 09:32:10 -07:00
committed by GitHub
parent c936e2e44e
commit 8978ab09b2
2 changed files with 24 additions and 1 deletions
+1 -1
View File
@@ -539,7 +539,7 @@ template <typename Char> class basic_string_view {
#endif
FMT_CONSTEXPR20 basic_string_view(const Char* s) : data_(s) {
#if FMT_HAS_BUILTIN(__builtin_strlen) || FMT_GCC_VERSION || FMT_CLANG_VERSION
if (std::is_same<Char, char>::value) {
if (std::is_same<Char, char>::value && !detail::is_constant_evaluated()) {
size_ = __builtin_strlen(detail::narrow(s));
return;
}