[libcxx-commits] [libcxx] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Sep 18 06:43:19 PDT 2023
================
@@ -880,7 +880,7 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string()
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
: __r_(__default_init_tag(), __default_init_tag()) {
- __default_init();
+ __r_.first() = __rep();
----------------
philnik777 wrote:
I think this could just be
```suggestion
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string()
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
: __r_(__value_init_tag(), __default_init_tag()) {}
```
Same for the change below.
https://github.com/llvm/llvm-project/pull/66576
More information about the libcxx-commits
mailing list