[libcxx-commits] [libcxx] [libc++] Add a release note about multi{map, set}::find not returning the first element anymore (PR #155252)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Aug 25 07:49:40 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: Nikolas Klauser (philnik777)
<details>
<summary>Changes</summary>
We've modified the algorithm of `__tree::find` in #<!-- -->152370, which can change the return value. Since we're always returned the lower bound before some users started relying on it. This patch adds a release note so users are aware that this might break their code.
---
Full diff: https://github.com/llvm/llvm-project/pull/155252.diff
1 Files Affected:
- (modified) libcxx/docs/ReleaseNotes/22.rst (+4)
``````````diff
diff --git a/libcxx/docs/ReleaseNotes/22.rst b/libcxx/docs/ReleaseNotes/22.rst
index a26c5476d421b..6be269cfbbc84 100644
--- a/libcxx/docs/ReleaseNotes/22.rst
+++ b/libcxx/docs/ReleaseNotes/22.rst
@@ -61,6 +61,10 @@ Deprecations and Removals
Potentially breaking changes
----------------------------
+- The algorithm for ``multi{map,set}::find`` has been modified, which doesn't guarantee that the first element is
+ returned. If code relies on the first element being returned from ``find`` it may be broken. To fix it use
+ ``lower_bound`` or ``equal_range`` instead.
+
Announcements About Future Releases
-----------------------------------
``````````
</details>
https://github.com/llvm/llvm-project/pull/155252
More information about the libcxx-commits
mailing list