Re: [PATCH] libstdc++: increment *this instead of this

2024-05-18 Thread Kefu Chai
On Sat, May 18, 2024 at 3:25 PM Jakub Jelinek wrote: > On Sat, May 18, 2024 at 02:53:20PM +0800, Kefu Chai wrote: > > libstdc++-v3/ChangeLog: > > > > * include/bits/unicode.h (enable_borrowed_range): Call ++(*this) > > instead of ++this > > This s

[PATCH] libstdc++: increment *this instead of this

2024-05-17 Thread Kefu Chai
From: Kefu Chai in _Grapheme_cluster_view::_Iterator, we implement its post-increment operator (a++) using its pre-increment opereator (++a). but we use ++this to call the pre-increment opereator in the implementation of the post-increment operator. one cannot assign to `this`. both GCC and

Re: [PATCH v2 0/1] Set _M_string_length before calling _M_dispose()

2023-05-03 Thread kefu chai via Gcc-patches
Le mer. 3 mai 2023 à 20:22, Jonathan Wakely a écrit : > > > On Wed, 3 May 2023 at 03:17, Kefu Chai via Libstdc++ < > libstd...@gcc.gnu.org> wrote: > >> Hi Jonathan, >> >> Thank you for your review and suggestion. The change looks great! >> Assigning

[PATCH v2 1/1] libstdc++: Set _M_string_length before calling _M_dispose() [PR109703]

2023-05-02 Thread Kefu Chai via Gcc-patches
range of input_iterator, and the uninitialized _M_string_length is greater than _S_local_capacity, i.e., 15. libstdc++-v3/ChangeLog: PR libstdc++/109703 * include/bits/basic_string.h (basic_string(Iter, Iter, Alloc)): Initialize _M_string_length. Signed-off-by: Kefu Cha

[PATCH v2 0/1] Set _M_string_length before calling _M_dispose()

2023-05-02 Thread Kefu Chai via Gcc-patches
/libstdc++/109703. as I just filed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109706, which turns out to be a dup of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109703 The rest of the v2 patch is identical to the one attached in your reply. Would you please taking another look? Kefu Chai (1