File tree Expand file tree Collapse file tree 6 files changed +14
-14
lines changed
Expand file tree Collapse file tree 6 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -465,13 +465,13 @@ class flat_map {
465465 }
466466
467467 // [flat.map.access], element access
468- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 mapped_type& operator [](const key_type& __x)
468+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 mapped_type& operator [](const key_type& __x)
469469 requires is_constructible_v<mapped_type>
470470 {
471471 return try_emplace (__x).first ->second ;
472472 }
473473
474- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 mapped_type& operator [](key_type&& __x)
474+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 mapped_type& operator [](key_type&& __x)
475475 requires is_constructible_v<mapped_type>
476476 {
477477 return try_emplace (std::move (__x)).first ->second ;
@@ -480,7 +480,7 @@ class flat_map {
480480 template <class _Kp >
481481 requires (__is_compare_transparent && is_constructible_v<key_type, _Kp> && is_constructible_v<mapped_type> &&
482482 !is_convertible_v<_Kp &&, const_iterator> && !is_convertible_v<_Kp &&, iterator>)
483- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 mapped_type& operator [](_Kp&& __x) {
483+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 mapped_type& operator [](_Kp&& __x) {
484484 return try_emplace (std::forward<_Kp>(__x)).first ->second ;
485485 }
486486
Original file line number Diff line number Diff line change @@ -1092,9 +1092,9 @@ public:
10921092 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type size () const _NOEXCEPT { return __tree_.size (); }
10931093 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type max_size () const _NOEXCEPT { return __tree_.max_size (); }
10941094
1095- [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI mapped_type& operator [](const key_type& __k);
1095+ _LIBCPP_HIDE_FROM_ABI mapped_type& operator [](const key_type& __k);
10961096# ifndef _LIBCPP_CXX03_LANG
1097- [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI mapped_type& operator [](key_type&& __k);
1097+ _LIBCPP_HIDE_FROM_ABI mapped_type& operator [](key_type&& __k);
10981098# endif
10991099
11001100 template <class _Arg ,
Original file line number Diff line number Diff line change @@ -1262,9 +1262,9 @@ public:
12621262 }
12631263# endif // _LIBCPP_STD_VER >= 20
12641264
1265- [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI mapped_type& operator [](const key_type& __k);
1265+ _LIBCPP_HIDE_FROM_ABI mapped_type& operator [](const key_type& __k);
12661266# ifndef _LIBCPP_CXX03_LANG
1267- [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI mapped_type& operator [](key_type&& __k);
1267+ _LIBCPP_HIDE_FROM_ABI mapped_type& operator [](key_type&& __k);
12681268# endif
12691269
12701270 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI mapped_type& at (const key_type& __k);
Original file line number Diff line number Diff line change @@ -66,9 +66,9 @@ void test() {
6666 TransparentKey<int > tkey;
6767
6868 std::flat_map<int , int > nfm;
69- nfm[key]; // expected -warning {{ignoring return value of function declared with 'nodiscard' attribute}}
70- fm[std::move (key)]; // expected -warning {{ignoring return value of function declared with 'nodiscard' attribute}}
71- fm[std::move (tkey)]; // expected -warning {{ignoring return value of function declared with 'nodiscard' attribute}}
69+ nfm[key]; // no -warning
70+ fm[std::move (key)]; // no -warning
71+ fm[std::move (tkey)]; // no -warning
7272
7373 fm.at (key); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
7474 cfm.at (key); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
Original file line number Diff line number Diff line change @@ -55,8 +55,8 @@ void test() {
5555
5656 int key = 0 ;
5757
58- m[key]; // expected -warning {{ignoring return value of function declared with 'nodiscard' attribute}}
59- m[std::move (key)]; // expected -warning {{ignoring return value of function declared with 'nodiscard' attribute}}
58+ m[key]; // no -warning
59+ m[std::move (key)]; // no -warning
6060
6161#if TEST_STD_VER >= 14
6262 std::map<std::string, int , std::less<>> strMap;
Original file line number Diff line number Diff line change @@ -81,8 +81,8 @@ void test() {
8181 ctm.equal_range (tkey); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
8282#endif
8383
84- m[key]; // expected -warning {{ignoring return value of function declared with 'nodiscard' attribute}}
85- m[std::move (key)]; // expected -warning {{ignoring return value of function declared with 'nodiscard' attribute}}
84+ m[key]; // no -warning
85+ m[std::move (key)]; // no -warning
8686
8787 m.at (key); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
8888 cm.at (key); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
You can’t perform that action at this time.
0 commit comments