aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2024-10-17 21:18:14 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2024-10-18 14:49:34 +0100
commit5546be4c24cd1085c8e43b5635be56a9b591c626 (patch)
tree3ae9b3c46b7e0054daf2247ebb662fa609671c8b
parent7ed561f63e7955df4d194669998176df5ef47803 (diff)
downloadgcc-5546be4c24cd1085c8e43b5635be56a9b591c626.zip
gcc-5546be4c24cd1085c8e43b5635be56a9b591c626.tar.gz
gcc-5546be4c24cd1085c8e43b5635be56a9b591c626.tar.bz2
libstdc++: Add nodiscard to std::find
I missed this one out in r14-9478-gdf483ebd24689a but I don't think that was intentional. I see no reason std::find shouldn't be [[nodiscard]]. libstdc++-v3/ChangeLog: * include/bits/stl_algo.h (find): Add nodiscard. Reviewed-by: Patrick Palka <ppalka@redhat.com>
-rw-r--r--libstdc++-v3/include/bits/stl_algo.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h
index 489ce7e..780bd8e 100644
--- a/libstdc++-v3/include/bits/stl_algo.h
+++ b/libstdc++-v3/include/bits/stl_algo.h
@@ -3820,7 +3820,7 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
* such that @c *i == @p __val, or @p __last if no such iterator exists.
*/
template<typename _InputIterator, typename _Tp>
- _GLIBCXX20_CONSTEXPR
+ _GLIBCXX_NODISCARD _GLIBCXX20_CONSTEXPR
inline _InputIterator
find(_InputIterator __first, _InputIterator __last, const _Tp& __val)
{