[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:20:20 PDT 2023


================
@@ -830,8 +830,8 @@ private:
     {
         union
         {
-            __long  __l;
             __short __s;
+            __long  __l;
             __raw   __r;
----------------
jyknight wrote:

The use of `if (__libcpp_is_constant_evaluated()) __r_.first() = __rep();` throughout the code will activate the first alternative in the union. Now, we want that default-active alternative to be the short repr, so I moved it to be first.

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


More information about the libcxx-commits mailing list