[qt/clang/llvm-project]: Summary of bulk changes made

KDE Git Services - Bulk Change <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git repository change summary for qt/clang/llvm-project
Pushed by mirror-service into branch 'upstream/users/jtstogel/realpath/string-view-assign'.
Changed from 7d1cbf9189a565ef55ec9165bdbb735cf243aadf to a9b2e94c4c307fba1dbfe350a91967b3e9d6cf7a
Acknowledgement was received that this change introduces only existing code that has been pushed to another public open source repository.

This change contains the following new commits:

Git commit a9b2e94c4c307fba1dbfe350a91967b3e9d6cf7a by jtstogel on 21/07/2026 at 07:25..
[libc][cpp::string] Allocate fewer temp strings in operator= and +=

This PR generally updates `cpp::string` to avoid incidental allocations. Specifically, it:

- Updates `opreator=(string_view)` to avoid allocating a temporary string: https://github.com/llvm/llvm-project/blob/67ebc4b221c3e94028b33004cd5cd08deee95048/libc/src/__support/CPP/string.h#L106-L108
- Changes `operator+=(const string&)` to accept a `string_view` so that strings may be appended without allocation.
- Makes the `string(string_view)` constructor explicit. Before, there were non-obvious allocations because of the implicit conversion.

This PR assumes that self-assignment and self-appends are not supported with `cpp::string`, and adds debug asserts preventing them. Currently, assignment doesn't work. `cpp::string s = "abc"; s = s;` will just zero out the string. This PR is a slight regression in that `operator+=(const cpp::string&)` previously worked, but now it errors in debug mode, and would result in a use-after-free without the assert statement. I don't think self-append/self-assignment is something `cpp::string` needs to support, so I omitted it, but if a reviewer thinks this behavior is important happy to amend this PR.
https://invent.kde.org/qt/clang/llvm-project/-/commit/a9b2e94c4c307fba1dbfe350a91967b3e9d6cf7a
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.