Clang still complains about using std::string in constexpr contexts due
to the changes made in commit
98a0d72a. This patch ensures that we set
the active member of the union as according to [class.union.general] p6.
libstdc++-v3/ChangeLog:
PR libstdc++/103295
* include/bits/basic_string.h (_M_use_local_data): Set active
member to _M_local_buf.
Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
{
#if __cpp_lib_is_constant_evaluated
if (std::is_constant_evaluated())
- for (_CharT& __c : _M_local_buf)
- __c = _CharT();
+ for (size_type __i = 0; __i <= _S_local_capacity; ++__i)
+ _M_local_buf[__i] = _CharT();
#endif
return _M_local_data();
}