[libcxx-commits] [libcxx] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)

James Y Knight via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 18 06:19:56 PDT 2023


================
@@ -1729,8 +1729,10 @@ private:
 
     _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
     bool __is_long() const _NOEXCEPT {
-        if (__libcpp_is_constant_evaluated())
-            return true;
+        if (__libcpp_is_constant_evaluated()) {
+            if (__builtin_constant_p(__r_.first().__l.__is_long_))
+                return __r_.first().__l.__is_long_;
+        }
----------------
jyknight wrote:

Done.

https://github.com/llvm/llvm-project/pull/66576


More information about the libcxx-commits mailing list