File tree Expand file tree Collapse file tree 4 files changed +277
-72
lines changed
test/libcxx/utilities/expected Expand file tree Collapse file tree 4 files changed +277
-72
lines changed Original file line number Diff line number Diff line change @@ -43,9 +43,11 @@ class _LIBCPP_EXPORTED_FROM_ABI bad_expected_access<void> : public exception {
4343
4444public:
4545# if _LIBCPP_AVAILABILITY_HAS_BAD_EXPECTED_ACCESS_KEY_FUNCTION
46- const char * what () const noexcept override ;
46+ [[nodiscard]] const char * what () const noexcept override ;
4747# else
48- _LIBCPP_HIDE_FROM_ABI_VIRTUAL const char * what () const noexcept override { return " bad access to std::expected" ; }
48+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI_VIRTUAL const char * what () const noexcept override {
49+ return " bad access to std::expected" ;
50+ }
4951# endif
5052};
5153_LIBCPP_DIAGNOSTIC_POP
@@ -55,10 +57,10 @@ class bad_expected_access : public bad_expected_access<void> {
5557public:
5658 _LIBCPP_HIDE_FROM_ABI explicit bad_expected_access (_Err __e) : __unex_(std::move(__e)) {}
5759
58- _LIBCPP_HIDE_FROM_ABI _Err& error () & noexcept { return __unex_; }
59- _LIBCPP_HIDE_FROM_ABI const _Err& error () const & noexcept { return __unex_; }
60- _LIBCPP_HIDE_FROM_ABI _Err&& error() && noexcept { return std::move (__unex_); }
61- _LIBCPP_HIDE_FROM_ABI const _Err&& error() const && noexcept { return std::move (__unex_); }
60+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _Err& error () & noexcept { return __unex_; }
61+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const _Err& error () const & noexcept { return __unex_; }
62+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _Err&& error() && noexcept { return std::move (__unex_); }
63+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const _Err&& error() const && noexcept { return std::move (__unex_); }
6264
6365private:
6466 _Err __unex_;
You can’t perform that action at this time.
0 commit comments