[libcxx-commits] [PATCH] D154499: [libc++] Do not use stringbuf's string after move

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 11 14:29:03 PDT 2023


philnik added a comment.

In D154499#4474861 <https://reviews.llvm.org/D154499#4474861>, @pfusik wrote:

> In D154499#4474816 <https://reviews.llvm.org/D154499#4474816>, @philnik wrote:
>
>> I am quite certain that `basic_stringbuf` has to be in a valid but unspecified state
>
> https://timsong-cpp.github.io/cppwp/n4868/stringbuf#cons-11.13

Interesting. IIUC the buffer has to be empty after a move. We can test for that, but it looks to me like that's already the case with the old code. Since you claim that this is a bug fix, this has to be observable in some way by the user without checking for unspecified behavior. Otherwise this is basically an NFC without any reasoning for why the new code is better. It actually looks to me like the old code is correct.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154499



More information about the libcxx-commits mailing list