@@ -44,9 +44,9 @@ struct coroutine_handle<void> {
4444 }
4545
4646 // [coroutine.handle.export.import], export/import
47- _LIBCPP_HIDE_FROM_ABI constexpr void * address () const noexcept { return __handle_; }
47+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr void * address () const noexcept { return __handle_; }
4848
49- _LIBCPP_HIDE_FROM_ABI static constexpr coroutine_handle from_address (void * __addr) noexcept {
49+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr coroutine_handle from_address (void * __addr) noexcept {
5050 coroutine_handle __tmp;
5151 __tmp.__handle_ = __addr;
5252 return __tmp;
@@ -55,7 +55,7 @@ struct coroutine_handle<void> {
5555 // [coroutine.handle.observers], observers
5656 _LIBCPP_HIDE_FROM_ABI constexpr explicit operator bool () const noexcept { return __handle_ != nullptr ; }
5757
58- _LIBCPP_HIDE_FROM_ABI bool done () const {
58+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool done () const {
5959 _LIBCPP_ASSERT_VALID_EXTERNAL_API_CALL (__is_suspended (), " done() can be called only on suspended coroutines" );
6060 return __builtin_coro_done (__handle_);
6161 }
@@ -100,7 +100,7 @@ struct coroutine_handle {
100100
101101 _LIBCPP_HIDE_FROM_ABI constexpr coroutine_handle (nullptr_t ) noexcept {}
102102
103- _LIBCPP_HIDE_FROM_ABI static coroutine_handle from_promise (_Promise& __promise) {
103+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static coroutine_handle from_promise (_Promise& __promise) {
104104 using _RawPromise = __remove_cv_t <_Promise>;
105105 coroutine_handle __tmp;
106106 __tmp.__handle_ =
@@ -114,9 +114,9 @@ struct coroutine_handle {
114114 }
115115
116116 // [coroutine.handle.export.import], export/import
117- _LIBCPP_HIDE_FROM_ABI constexpr void * address () const noexcept { return __handle_; }
117+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr void * address () const noexcept { return __handle_; }
118118
119- _LIBCPP_HIDE_FROM_ABI static constexpr coroutine_handle from_address (void * __addr) noexcept {
119+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr coroutine_handle from_address (void * __addr) noexcept {
120120 coroutine_handle __tmp;
121121 __tmp.__handle_ = __addr;
122122 return __tmp;
@@ -130,7 +130,7 @@ struct coroutine_handle {
130130 // [coroutine.handle.observers], observers
131131 _LIBCPP_HIDE_FROM_ABI constexpr explicit operator bool () const noexcept { return __handle_ != nullptr ; }
132132
133- _LIBCPP_HIDE_FROM_ABI bool done () const {
133+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool done () const {
134134 _LIBCPP_ASSERT_VALID_EXTERNAL_API_CALL (__is_suspended (), " done() can be called only on suspended coroutines" );
135135 return __builtin_coro_done (__handle_);
136136 }
@@ -150,7 +150,7 @@ struct coroutine_handle {
150150 }
151151
152152 // [coroutine.handle.promise], promise access
153- _LIBCPP_HIDE_FROM_ABI _Promise& promise () const {
153+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _Promise& promise () const {
154154 return *static_cast <_Promise*>(__builtin_coro_promise (this ->__handle_ , alignof (_Promise), false ));
155155 }
156156
@@ -165,7 +165,7 @@ struct coroutine_handle {
165165// [coroutine.handle.hash]
166166template <class _Tp >
167167struct hash <coroutine_handle<_Tp>> {
168- _LIBCPP_HIDE_FROM_ABI size_t operator ()(const coroutine_handle<_Tp>& __v) const noexcept {
168+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI size_t operator ()(const coroutine_handle<_Tp>& __v) const noexcept {
169169 return hash<void *>()(__v.address ());
170170 }
171171};
0 commit comments