aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/ext
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2019-01-21 11:47:30 +0000
committerUlrich Drepper <drepper@gcc.gnu.org>2019-01-21 11:47:30 +0000
commitd715f5543117af088e6d8099806b266aa2dac047 (patch)
tree8a278f392e532b7d9a500a1ea59be3d154a5bd0e /libstdc++-v3/include/ext
parent91f1f6cd66d6b34c8938d11735708646a338e8d2 (diff)
downloadgcc-d715f5543117af088e6d8099806b266aa2dac047.zip
gcc-d715f5543117af088e6d8099806b266aa2dac047.tar.gz
gcc-d715f5543117af088e6d8099806b266aa2dac047.tar.bz2
Fix after P0600.
gcc/testsuite/ChangeLog 2019-02-20 Ulrich Drepper <drepper@redhat.com> Fix after P0600. * g++.dg/init/new39.C: Don't just ignore result of new. libstdc++/ChangeLog 2019-02-20 Ulrich Drepper <drepper@redhat.com> Implement C++20 P0600r1. * include/backward/hash_map: Add nodiscard attribute to empty. * include/backward/hash_set: Likewise. * backward/hashtable.h: Likewise. * include/bits/basic_string.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/hashtable.h: Likewise. * include/bits/regex.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_map.h: Likewise. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Likewise. * include/bits/stl_queue.h: Likewise. * include/bits/stl_set.h: Likewise. * include/bits/stl_stack.h: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/unordered_map.h: Likewise. * include/bits/unordered_set.h: Likewise. * include/debug/array: Likewise. * include/experimental/any: Likewise. * include/experimental/bits/fs_path.h: Likewise. * include/experimental/internet: Likewise. * include/experimental/string_view: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hp: Likewise. * include/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp: Likewise. * include/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp: Likewise. * include/ext/pb_ds/detail/tree_trace_base.hpp: Likewise. * include/ext/pb_ds/trie_policy.hpp: Likewise. * include/ext/rope: Likewise. * include/ext/slist: Likewise. * include/ext/vstring.h: Likewise. * include/profile/array: Likewise. * include/std/array: Likewise. * include/tr1/array: Likewise. * include/tr1/hashtable.h: Likewise. * include/tr1/regex: Likewise. * include/tr2/dynamic_bitset: Likewise. * include/bits/alloc_traits.h: Add nodiscard attribute to allocate. * include/experimental/memory_resource: Likewise. * include/ext/alloc_traits.h: Likewise. * include/ext/array_allocator.h: Likewise. * include/ext/bitmap_allocator.h: Likewise. * include/ext/debug_allocator.h: Likewise. * include/ext/extptr_allocator.h: Likewise. * include/ext/mt_allocator.h: Likewise. * include/ext/new_allocator.h: Likewise. * include/ext/pool_allocator.h: Likewise. * include/ext/throw_allocator.h: Likewise. * include/std/scoped_allocator: Likewise. * libsupc++/eh_alloc.cc: Likewise. * include/std/future: Add nodiscard attribute to async. * libsupc++/new: Add nodiscard attribute to new. From-SVN: r268111
Diffstat (limited to 'libstdc++-v3/include/ext')
-rw-r--r--libstdc++-v3/include/ext/alloc_traits.h2
-rw-r--r--libstdc++-v3/include/ext/array_allocator.h2
-rw-r--r--libstdc++-v3/include/ext/bitmap_allocator.h6
-rw-r--r--libstdc++-v3/include/ext/debug_allocator.h4
-rw-r--r--libstdc++-v3/include/ext/extptr_allocator.h2
-rw-r--r--libstdc++-v3/include/ext/mt_allocator.h4
-rw-r--r--libstdc++-v3/include/ext/new_allocator.h2
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp1
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp2
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp1
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp2
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp1
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp1
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp2
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp1
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp1
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp2
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp1
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp2
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp1
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp2
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp1
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp4
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp4
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/tree_trace_base.hpp2
-rw-r--r--libstdc++-v3/include/ext/pb_ds/trie_policy.hpp2
-rw-r--r--libstdc++-v3/include/ext/pool_allocator.h4
-rw-r--r--libstdc++-v3/include/ext/rope2
-rw-r--r--libstdc++-v3/include/ext/slist2
-rw-r--r--libstdc++-v3/include/ext/throw_allocator.h2
-rw-r--r--libstdc++-v3/include/ext/vstring.h2
31 files changed, 38 insertions, 29 deletions
diff --git a/libstdc++-v3/include/ext/alloc_traits.h b/libstdc++-v3/include/ext/alloc_traits.h
index 5571d26..65fa3de 100644
--- a/libstdc++-v3/include/ext/alloc_traits.h
+++ b/libstdc++-v3/include/ext/alloc_traits.h
@@ -128,7 +128,7 @@ template<typename _Alloc, typename = typename _Alloc::value_type>
typedef typename _Alloc::size_type size_type;
typedef typename _Alloc::difference_type difference_type;
- static pointer
+ _GLIBCXX_NODISCARD static pointer
allocate(_Alloc& __a, size_type __n)
{ return __a.allocate(__n); }
diff --git a/libstdc++-v3/include/ext/array_allocator.h b/libstdc++-v3/include/ext/array_allocator.h
index 6dd23cd..c0d4a34 100644
--- a/libstdc++-v3/include/ext/array_allocator.h
+++ b/libstdc++-v3/include/ext/array_allocator.h
@@ -151,7 +151,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
~array_allocator() _GLIBCXX_USE_NOEXCEPT { }
- pointer
+ _GLIBCXX_NODISCARD pointer
allocate(size_type __n, const void* = 0)
{
if (_M_array == 0 || _M_used + __n > _M_array->size())
diff --git a/libstdc++-v3/include/ext/bitmap_allocator.h b/libstdc++-v3/include/ext/bitmap_allocator.h
index 400030b..532bad2 100644
--- a/libstdc++-v3/include/ext/bitmap_allocator.h
+++ b/libstdc++-v3/include/ext/bitmap_allocator.h
@@ -90,7 +90,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_space_left() const throw()
{ return _M_end_of_storage - _M_finish; }
- pointer
+ _GLIBCXX_NODISCARD pointer
allocate(size_type __n)
{ return static_cast<pointer>(::operator new(__n * sizeof(_Tp))); }
@@ -1009,7 +1009,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
~bitmap_allocator() _GLIBCXX_USE_NOEXCEPT
{ }
- pointer
+ _GLIBCXX_NODISCARD pointer
allocate(size_type __n)
{
if (__n > this->max_size())
@@ -1033,7 +1033,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
}
- pointer
+ _GLIBCXX_NODISCARD pointer
allocate(size_type __n, typename bitmap_allocator<void>::const_pointer)
{ return allocate(__n); }
diff --git a/libstdc++-v3/include/ext/debug_allocator.h b/libstdc++-v3/include/ext/debug_allocator.h
index bf86470..c5fc57e 100644
--- a/libstdc++-v3/include/ext/debug_allocator.h
+++ b/libstdc++-v3/include/ext/debug_allocator.h
@@ -118,7 +118,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
debug_allocator(const _Alloc& __a)
: _M_allocator(__a), _M_extra(_S_extra()) { }
- pointer
+ _GLIBCXX_NODISCARD pointer
allocate(size_type __n)
{
pointer __res = _M_allocator.allocate(__n + _M_extra);
@@ -127,7 +127,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return __res + _M_extra;
}
- pointer
+ _GLIBCXX_NODISCARD pointer
allocate(size_type __n, const void* __hint)
{
pointer __res = _M_allocator.allocate(__n + _M_extra, __hint);
diff --git a/libstdc++-v3/include/ext/extptr_allocator.h b/libstdc++-v3/include/ext/extptr_allocator.h
index 388edb2..2ce87b60 100644
--- a/libstdc++-v3/include/ext/extptr_allocator.h
+++ b/libstdc++-v3/include/ext/extptr_allocator.h
@@ -92,7 +92,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
const_pointer address(const_reference __x) const _GLIBCXX_NOEXCEPT
{ return std::__addressof(__x); }
- pointer allocate(size_type __n, void* __hint = 0)
+ _GLIBCXX_NODISCARD pointer allocate(size_type __n, void* __hint = 0)
{ return _M_real_alloc.allocate(__n,__hint); }
void deallocate(pointer __p, size_type __n)
diff --git a/libstdc++-v3/include/ext/mt_allocator.h b/libstdc++-v3/include/ext/mt_allocator.h
index 7b07533..43e84f4 100644
--- a/libstdc++-v3/include/ext/mt_allocator.h
+++ b/libstdc++-v3/include/ext/mt_allocator.h
@@ -665,7 +665,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
~__mt_alloc() _GLIBCXX_USE_NOEXCEPT { }
- pointer
+ _GLIBCXX_NODISCARD pointer
allocate(size_type __n, const void* = 0);
void
@@ -684,7 +684,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
};
template<typename _Tp, typename _Poolp>
- typename __mt_alloc<_Tp, _Poolp>::pointer
+ _GLIBCXX_NODISCARD typename __mt_alloc<_Tp, _Poolp>::pointer
__mt_alloc<_Tp, _Poolp>::
allocate(size_type __n, const void*)
{
diff --git a/libstdc++-v3/include/ext/new_allocator.h b/libstdc++-v3/include/ext/new_allocator.h
index 04db4bb..e245391 100644
--- a/libstdc++-v3/include/ext/new_allocator.h
+++ b/libstdc++-v3/include/ext/new_allocator.h
@@ -98,7 +98,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// NB: __n is permitted to be 0. The C++ standard says nothing
// about what the return value is when __n == 0.
- pointer
+ _GLIBCXX_NODISCARD pointer
allocate(size_type __n, const void* = static_cast<const void*>(0))
{
if (__n > this->max_size())
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp
index 5e73955..4019f86 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp
@@ -39,6 +39,7 @@
*/
PB_DS_CLASS_T_DEC
+_GLIBCXX_NODISCARD
inline bool
PB_DS_CLASS_C_DEC::
empty() const
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp b/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp
index 40ddeed5..dbfd612 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp
@@ -144,7 +144,7 @@ namespace __gnu_pbds
~binary_heap();
- inline bool
+ _GLIBCXX_NODISCARD inline bool
empty() const;
inline size_type
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp
index 29612fa..d81d550 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp
@@ -39,6 +39,7 @@
*/
PB_DS_CLASS_T_DEC
+_GLIBCXX_NODISCARD
inline bool
PB_DS_CLASS_C_DEC::
empty() const
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp
index 6706c1a..1a6affc 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp
@@ -271,7 +271,7 @@ namespace __gnu_pbds
max_size() const;
/// True if size() == 0.
- inline bool
+ _GLIBCXX_NODISCARD inline bool
empty() const;
/// Return current hash_fn.
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp
index 7b5318b..9d38890 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp
@@ -52,6 +52,7 @@ max_size() const
{ return m_entry_allocator.max_size(); }
PB_DS_CLASS_T_DEC
+_GLIBCXX_NODISCARD
inline bool
PB_DS_CLASS_C_DEC::
empty() const
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp
index 500b92f..bcc1fc4 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp
@@ -46,6 +46,7 @@ size() const
{ return m_num_used_e; }
PB_DS_CLASS_T_DEC
+_GLIBCXX_NODISCARD
inline bool
PB_DS_CLASS_C_DEC::
empty() const
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp b/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp
index bcac913..90dfd50 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp
@@ -279,7 +279,7 @@ namespace __gnu_pbds
max_size() const;
/// True if size() == 0.
- inline bool
+ _GLIBCXX_NODISCARD inline bool
empty() const;
/// Return current hash_fn.
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp
index 64fa975..464216e 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp
@@ -52,6 +52,7 @@ max_size() const
{ return s_entry_allocator.max_size(); }
PB_DS_CLASS_T_DEC
+_GLIBCXX_NODISCARD
inline bool
PB_DS_CLASS_C_DEC::
empty() const
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp
index 8d31e5b..d12710a 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp
@@ -39,6 +39,7 @@
*/
PB_DS_CLASS_T_DEC
+_GLIBCXX_NODISCARD
inline bool
PB_DS_CLASS_C_DEC::
empty() const
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp
index 746a3d8..32d67eb 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp
@@ -144,7 +144,7 @@ namespace __gnu_pbds
~left_child_next_sibling_heap();
- inline bool
+ _GLIBCXX_NODISCARD inline bool
empty() const;
inline size_type
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp
index 2c44a51..5d2e81f 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp
@@ -51,6 +51,7 @@ max_size() const
{ return s_entry_allocator.max_size(); }
PB_DS_CLASS_T_DEC
+_GLIBCXX_NODISCARD
inline bool
PB_DS_CLASS_C_DEC::
empty() const
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp b/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp
index e3539a5..a3c0fb4 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp
@@ -198,7 +198,7 @@ namespace __gnu_pbds
inline size_type
max_size() const;
- inline bool
+ _GLIBCXX_NODISCARD inline bool
empty() const;
inline mapped_reference
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp
index 26f33bf..81e7305 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp
@@ -54,6 +54,7 @@ max_size() const
{ return s_value_alloc.max_size(); }
PB_DS_CLASS_T_DEC
+_GLIBCXX_NODISCARD
inline bool
PB_DS_CLASS_C_DEC::
empty() const
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp b/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp
index efebc35..0859da1 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp
@@ -239,7 +239,7 @@ namespace __gnu_pbds
inline size_type
max_size() const;
- inline bool
+ _GLIBCXX_NODISCARD inline bool
empty() const;
inline size_type
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp
index 0f6eaf5..33fc3e1 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp
@@ -39,6 +39,7 @@
*/
PB_DS_CLASS_T_DEC
+_GLIBCXX_NODISCARD
inline bool
PB_DS_CLASS_C_DEC::
empty() const
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp
index 13da3d4..3f7e054 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp
@@ -223,7 +223,7 @@ namespace __gnu_pbds
}
}
- inline bool
+ _GLIBCXX_NODISCARD inline bool
empty() const
{ return m_bag.empty(); }
};
@@ -279,7 +279,7 @@ namespace __gnu_pbds
~PB_DS_PAT_TRIE_NAME();
- inline bool
+ _GLIBCXX_NODISCARD inline bool
empty() const;
inline size_type
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp b/libstdc++-v3/include/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp
index 2d1b4e7..5c996d1 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp
@@ -87,7 +87,7 @@ namespace __gnu_pbds
inline void
pop();
- inline bool
+ _GLIBCXX_NODISCARD inline bool
empty() const;
inline size_type
@@ -178,7 +178,7 @@ namespace __gnu_pbds
}
template<typename _Node, typename _Alloc>
- inline bool
+ _GLIBCXX_NODISCARD inline bool
rc<_Node, _Alloc>::
empty() const
{
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/tree_trace_base.hpp b/libstdc++-v3/include/ext/pb_ds/detail/tree_trace_base.hpp
index 980ff97..3b349c7 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/tree_trace_base.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/tree_trace_base.hpp
@@ -80,7 +80,7 @@ namespace __gnu_pbds
void
trace_node(node_const_iterator, size_type) const;
- virtual bool
+ _GLIBCXX_NODISCARD virtual bool
empty() const = 0;
virtual node_const_iterator
diff --git a/libstdc++-v3/include/ext/pb_ds/trie_policy.hpp b/libstdc++-v3/include/ext/pb_ds/trie_policy.hpp
index 0b0683d..9c750aa 100644
--- a/libstdc++-v3/include/ext/pb_ds/trie_policy.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/trie_policy.hpp
@@ -315,7 +315,7 @@ namespace __gnu_pbds
typedef typename __rebind_ma::reference metadata_reference;
/// Returns true if the container is empty.
- virtual bool
+ _GLIBCXX_NODISCARD virtual bool
empty() const = 0;
/// Returns the iterator associated with the trie's first element.
diff --git a/libstdc++-v3/include/ext/pool_allocator.h b/libstdc++-v3/include/ext/pool_allocator.h
index 460f55d..4b23727 100644
--- a/libstdc++-v3/include/ext/pool_allocator.h
+++ b/libstdc++-v3/include/ext/pool_allocator.h
@@ -188,7 +188,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
destroy(pointer __p) { __p->~_Tp(); }
#endif
- pointer
+ _GLIBCXX_NODISCARD pointer
allocate(size_type __n, const void* = 0);
void
@@ -210,7 +210,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__pool_alloc<_Tp>::_S_force_new;
template<typename _Tp>
- _Tp*
+ _GLIBCXX_NODISCARD _Tp*
__pool_alloc<_Tp>::allocate(size_type __n, const void*)
{
pointer __ret = 0;
diff --git a/libstdc++-v3/include/ext/rope b/libstdc++-v3/include/ext/rope
index 4cc8285..127d113 100644
--- a/libstdc++-v3/include/ext/rope
+++ b/libstdc++-v3/include/ext/rope
@@ -1797,7 +1797,7 @@ protected:
static int _S_compare(const _RopeRep* __x, const _RopeRep* __y);
public:
- bool
+ _GLIBCXX_NODISCARD bool
empty() const
{ return 0 == this->_M_tree_ptr; }
diff --git a/libstdc++-v3/include/ext/slist b/libstdc++-v3/include/ext/slist
index 532235f..3b49ae2 100644
--- a/libstdc++-v3/include/ext/slist
+++ b/libstdc++-v3/include/ext/slist
@@ -458,7 +458,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
max_size() const
{ return size_type(-1); }
- bool
+ _GLIBCXX_NODISCARD bool
empty() const
{ return this->_M_head._M_next == 0; }
diff --git a/libstdc++-v3/include/ext/throw_allocator.h b/libstdc++-v3/include/ext/throw_allocator.h
index 52d58e6..38e80f7 100644
--- a/libstdc++-v3/include/ext/throw_allocator.h
+++ b/libstdc++-v3/include/ext/throw_allocator.h
@@ -829,7 +829,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
address(const_reference __x) const _GLIBCXX_NOEXCEPT
{ return std::__addressof(__x); }
- pointer
+ _GLIBCXX_NODISCARD pointer
allocate(size_type __n, std::allocator<void>::const_pointer hint = 0)
{
if (__n > this->max_size())
diff --git a/libstdc++-v3/include/ext/vstring.h b/libstdc++-v3/include/ext/vstring.h
index ddffebf..5942218 100644
--- a/libstdc++-v3/include/ext/vstring.h
+++ b/libstdc++-v3/include/ext/vstring.h
@@ -518,7 +518,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* Returns true if the %string is empty. Equivalent to
* <code>*this == ""</code>.
*/
- bool
+ _GLIBCXX_NODISCARD bool
empty() const _GLIBCXX_NOEXCEPT
{ return this->size() == 0; }