From 7c43f8b896be886acd4e6e0ba61f71a8aa1ebc35 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Thu, 1 Apr 2021 10:04:21 -0700 Subject: [PATCH] Don't use strlen at compile time (#2205) --- include/fmt/core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 19cb05b5..f88b4cfe 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -396,7 +396,7 @@ template class basic_string_view { FMT_CONSTEXPR #endif FMT_INLINE basic_string_view(const Char* s) : data_(s) { - if (std::is_same::value) + if (std::is_same::value && !detail::is_constant_evaluated()) size_ = std::strlen(reinterpret_cast(s)); else size_ = std::char_traits::length(s);