[libcxx-commits] [PATCH] D155185: [libc++] Work around #40363 for stringbuf::str()

Piotr Fusik via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 14 09:29:02 PDT 2023


pfusik marked 2 inline comments as done.
pfusik added inline comments.


================
Comment at: libcxx/include/sstream:232
 
+// TODO(LLVM 19): Remove this once we drop support for Clang 16,
+// which had this bug: https://github.com/llvm/llvm-project/issues/40363
----------------
Mordante wrote:
> Mordante wrote:
> > This is our typical pattern.
> Note this feels a bit of a hack, however since it's temporary I've no objection.
It was suggested by @ldionne in https://reviews.llvm.org/D153709 as a short-term solution.
BTW. can I link to inline comments in Differential?


================
Comment at: libcxx/include/sstream:341
-      requires __is_allocator<_SAlloc>::value
-    _LIBCPP_HIDE_FROM_ABI basic_string<char_type, traits_type, _SAlloc> str(const _SAlloc& __sa) const {
-        return basic_string<_CharT, _Traits, _SAlloc>(view(), __sa);
----------------
Mordante wrote:
> Why move this hunk?
It was an error to have this overload conditional on `_LIBCPP_BUILDING_LIBRARY` in the first place.
It shouldn't depend on `_LIBCPP_BUILDING_LIBRARY` because it doesn't conflict with the pre-C++20 `str() const` overload.
In this patch I change decorations of members under this condition, but this template method isn't problematic at all.

I put it here originally just to follow the order in the spec.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155185



More information about the libcxx-commits mailing list