Skip to content

Commit 18c80e8

Browse files
committed
Addressed review comment
1 parent a7bc728 commit 18c80e8

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

libcxx/include/__functional/reference_wrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class reference_wrapper : public __weak_result_type<_Tp> {
6262

6363
// invoke
6464
template <class... _ArgTypes>
65-
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __invoke_result_t<type&, _ArgTypes...>
65+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __invoke_result_t<type&, _ArgTypes...>
6666
operator()(_ArgTypes&&... __args) const
6767
#if _LIBCPP_STD_VER >= 17
6868
// Since is_nothrow_invocable requires C++17 LWG3764 is not backported

libcxx/test/libcxx/diagnostics/functional.nodiscard.verify.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ void test() {
5656

5757
std::reference_wrapper<int> rw{i};
5858
rw.get(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
59-
std::function<int(int)> vf;
60-
auto rwf = std::ref(vf);
61-
rwf(1); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
6259

6360
std::ref(i); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
6461
std::cref(i); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}

0 commit comments

Comments
 (0)