[libcxx-commits] [PATCH] D110598: [libc++] Implement P0980R1 (constexpr std::string)

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 13 14:14:21 PDT 2022


philnik added inline comments.


================
Comment at: libcxx/include/string:1593-1605
+    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    void __set_long_cap(size_type __s) _NOEXCEPT {
+        if (__libcpp_is_constant_evaluated())
+            __r_.first().__l.__cap_ = __s;
+        else
+            __r_.first().__l.__cap_  = __long_mask | __s;
+    }
----------------
ldionne wrote:
> I don't understand why this diff is required when running in `constexpr`. What happens if you remove it?
Fixed the bug!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110598/new/

https://reviews.llvm.org/D110598



More information about the libcxx-commits mailing list