aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2019-04-29 13:35:24 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2019-04-29 13:35:24 +0100
commitad1f4687368ea026a0060969da1edd4dc1abbbfe (patch)
treeefddc7d6b7f04bca9f7929d9a4fcfef31abdbf44
parent82b6276fb3da3922e1bc875d75f81d6a31ae32d8 (diff)
downloadgcc-ad1f4687368ea026a0060969da1edd4dc1abbbfe.zip
gcc-ad1f4687368ea026a0060969da1edd4dc1abbbfe.tar.gz
gcc-ad1f4687368ea026a0060969da1edd4dc1abbbfe.tar.bz2
Add nodiscard to std::vector<bool>::empty()
We already added it to the std::vector primary template. * include/bits/stl_bvector.h (vector<bool>::empty()): Add nodiscard attribute. From-SVN: r270648
-rw-r--r--libstdc++-v3/ChangeLog3
-rw-r--r--libstdc++-v3/include/bits/stl_bvector.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 5112bc8..a5482bb 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,8 @@
2019-04-29 Jonathan Wakely <jwakely@redhat.com>
+ * include/bits/stl_bvector.h (vector<bool>::empty()): Add nodiscard
+ attribute.
+
* include/bits/stl_iterator_base_types.h (_Iter_base): Remove unused
class template and partial specialization.
diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h
index 294f1e4..c60f4f0 100644
--- a/libstdc++-v3/include/bits/stl_bvector.h
+++ b/libstdc++-v3/include/bits/stl_bvector.h
@@ -878,7 +878,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
{ return size_type(const_iterator(this->_M_impl._M_end_addr(), 0)
- begin()); }
- bool
+ _GLIBCXX_NODISCARD bool
empty() const _GLIBCXX_NOEXCEPT
{ return begin() == end(); }