The _GLIBCXX_NODISCARD macro only expands to [[__nodiscard__]] for C++17 and later, but all supported compilers will allow us to use that for C++11 and C++14 too. Enable it for those older standards, to give improved diagnostics for users of those older standards.
libstdc++-v3/ChangeLog: * include/bits/c++config (_GLIBCXX_NODISCARD): Expand for C++11 and C++14. * testsuite/22_locale/locale/cons/12438.cc: Adjust dg-warning to expect nodiscard warnings for C++11 and C++14 as well. * testsuite/22_locale/locale/operations/2.cc: Likewise. * testsuite/25_algorithms/equal/debug/1_neg.cc: Likewise. * testsuite/25_algorithms/equal/debug/2_neg.cc: Likewise. * testsuite/25_algorithms/equal/debug/3_neg.cc: Likewise. * testsuite/25_algorithms/find_first_of/concept_check_1.cc: Likewise. * testsuite/25_algorithms/is_permutation/2.cc: Likewise. * testsuite/25_algorithms/lexicographical_compare/71545.cc: Likewise. * testsuite/25_algorithms/lower_bound/33613.cc: Likewise. * testsuite/25_algorithms/lower_bound/debug/irreflexive.cc: Likewise. * testsuite/25_algorithms/lower_bound/debug/partitioned_neg.cc: Likewise. * testsuite/25_algorithms/lower_bound/debug/partitioned_pred_neg.cc: Likewise. * testsuite/25_algorithms/minmax/3.cc: Likewise. * testsuite/25_algorithms/search/78346.cc: Likewise. * testsuite/25_algorithms/search_n/58358.cc: Likewise. * testsuite/25_algorithms/unique/1.cc: Likewise. * testsuite/25_algorithms/unique/11480.cc: Likewise. * testsuite/25_algorithms/upper_bound/33613.cc: Likewise. * testsuite/25_algorithms/upper_bound/debug/partitioned_neg.cc: Likewise. * testsuite/25_algorithms/upper_bound/debug/partitioned_pred_neg.cc: Likewise. * testsuite/27_io/ios_base/types/fmtflags/bitmask_operators.cc: Likewise. * testsuite/27_io/ios_base/types/iostate/bitmask_operators.cc: Likewise. * testsuite/27_io/ios_base/types/openmode/bitmask_operators.cc: Likewise. * testsuite/ext/concept_checks.cc: Likewise. * testsuite/ext/is_heap/47709.cc: Likewise. * testsuite/ext/is_sorted/cxx0x.cc: Likewise. --- Tested x86_64-linux. Also available for review at: https://forge.sourceware.org/gcc/gcc-TEST/pulls/22 As a later change, we could replace many uses of _GLIBCXX_DISCARD with using [[__nodiscard__]] directly, for code that isn't valid in C++98 anyway. Currently we use the macro, because it behaves differently for C++11/14 and C++17/20/... but this change would remove that difference. So we could just use the __nodiscard__ attribute directly. libstdc++-v3/include/bits/c++config | 2 +- libstdc++-v3/testsuite/22_locale/locale/cons/12438.cc | 2 +- libstdc++-v3/testsuite/22_locale/locale/operations/2.cc | 2 +- libstdc++-v3/testsuite/25_algorithms/equal/debug/1_neg.cc | 2 +- libstdc++-v3/testsuite/25_algorithms/equal/debug/2_neg.cc | 2 +- libstdc++-v3/testsuite/25_algorithms/equal/debug/3_neg.cc | 2 +- .../25_algorithms/find_first_of/concept_check_1.cc | 2 +- libstdc++-v3/testsuite/25_algorithms/is_permutation/2.cc | 2 +- .../25_algorithms/lexicographical_compare/71545.cc | 2 +- libstdc++-v3/testsuite/25_algorithms/lower_bound/33613.cc | 2 +- .../25_algorithms/lower_bound/debug/irreflexive.cc | 2 +- .../25_algorithms/lower_bound/debug/partitioned_neg.cc | 2 +- .../lower_bound/debug/partitioned_pred_neg.cc | 2 +- libstdc++-v3/testsuite/25_algorithms/minmax/3.cc | 2 +- libstdc++-v3/testsuite/25_algorithms/search/78346.cc | 2 +- libstdc++-v3/testsuite/25_algorithms/search_n/58358.cc | 2 +- libstdc++-v3/testsuite/25_algorithms/unique/1.cc | 2 +- libstdc++-v3/testsuite/25_algorithms/unique/11480.cc | 2 +- libstdc++-v3/testsuite/25_algorithms/upper_bound/33613.cc | 2 +- .../25_algorithms/upper_bound/debug/partitioned_neg.cc | 2 +- .../upper_bound/debug/partitioned_pred_neg.cc | 2 +- .../27_io/ios_base/types/fmtflags/bitmask_operators.cc | 8 ++++---- .../27_io/ios_base/types/iostate/bitmask_operators.cc | 8 ++++---- .../27_io/ios_base/types/openmode/bitmask_operators.cc | 8 ++++---- libstdc++-v3/testsuite/ext/concept_checks.cc | 8 ++++---- libstdc++-v3/testsuite/ext/is_heap/47709.cc | 3 +-- libstdc++-v3/testsuite/ext/is_sorted/cxx0x.cc | 3 +-- 27 files changed, 39 insertions(+), 41 deletions(-) diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config index 1076803a865..236906d2f79 100644 --- a/libstdc++-v3/include/bits/c++config +++ b/libstdc++-v3/include/bits/c++config @@ -169,7 +169,7 @@ #endif // Macro to warn about unused results. -#if __cplusplus >= 201703L +#if __cplusplus >= 201103L # define _GLIBCXX_NODISCARD [[__nodiscard__]] #else # define _GLIBCXX_NODISCARD diff --git a/libstdc++-v3/testsuite/22_locale/locale/cons/12438.cc b/libstdc++-v3/testsuite/22_locale/locale/cons/12438.cc index 4838e1ba693..72b6b15adf5 100644 --- a/libstdc++-v3/testsuite/22_locale/locale/cons/12438.cc +++ b/libstdc++-v3/testsuite/22_locale/locale/cons/12438.cc @@ -45,7 +45,7 @@ void test01(int iters) locale loc2 = locale(""); VERIFY( !has_facet<MyFacet>(loc2) ); - loc1.combine<MyFacet>(loc2); // { dg-warning "nodiscard" "" { target c++17 } } + loc1.combine<MyFacet>(loc2); // { dg-warning "nodiscard" "" { target c++11 } } VERIFY( false ); } catch (std::runtime_error&) diff --git a/libstdc++-v3/testsuite/22_locale/locale/operations/2.cc b/libstdc++-v3/testsuite/22_locale/locale/operations/2.cc index 917adecac56..c0a6613eb74 100644 --- a/libstdc++-v3/testsuite/22_locale/locale/operations/2.cc +++ b/libstdc++-v3/testsuite/22_locale/locale/operations/2.cc @@ -48,7 +48,7 @@ void test02() // Derivation, MF check. locale loc_gnu(loc_c, new gnu_collate); gnu_count = 0; - loc_gnu(s01, s02); // { dg-warning "nodiscard" "" { target c++17 } } + loc_gnu(s01, s02); // { dg-warning "nodiscard" "" { target c++11 } } VERIFY( gnu_count == 1 ); } diff --git a/libstdc++-v3/testsuite/25_algorithms/equal/debug/1_neg.cc b/libstdc++-v3/testsuite/25_algorithms/equal/debug/1_neg.cc index f9328599a55..38060b1bea4 100644 --- a/libstdc++-v3/testsuite/25_algorithms/equal/debug/1_neg.cc +++ b/libstdc++-v3/testsuite/25_algorithms/equal/debug/1_neg.cc @@ -27,7 +27,7 @@ test01() std::vector<int> vect; vect.push_back(1); std::equal(vect.end(), vect.begin(), vect.begin()); - // { dg-warning "ignoring return value" "" { target c++17 } 29 } + // { dg-warning "ignoring return value" "" { target c++11 } 29 } } int diff --git a/libstdc++-v3/testsuite/25_algorithms/equal/debug/2_neg.cc b/libstdc++-v3/testsuite/25_algorithms/equal/debug/2_neg.cc index 2e9134a74ea..5148571fa21 100644 --- a/libstdc++-v3/testsuite/25_algorithms/equal/debug/2_neg.cc +++ b/libstdc++-v3/testsuite/25_algorithms/equal/debug/2_neg.cc @@ -27,7 +27,7 @@ test01() std::vector<int> v1, v2; v1.push_back(1); std::equal(v1.begin(), v1.end(), v2.begin()); - // { dg-warning "ignoring return value" "" { target c++17 } 29 } + // { dg-warning "ignoring return value" "" { target c++11 } 29 } } int diff --git a/libstdc++-v3/testsuite/25_algorithms/equal/debug/3_neg.cc b/libstdc++-v3/testsuite/25_algorithms/equal/debug/3_neg.cc index 425e7aa78c6..5a176306c2b 100644 --- a/libstdc++-v3/testsuite/25_algorithms/equal/debug/3_neg.cc +++ b/libstdc++-v3/testsuite/25_algorithms/equal/debug/3_neg.cc @@ -33,7 +33,7 @@ test01() l2.push_back(2); std::equal(++l1.begin(), l1.end(), ++l2.begin()); - // { dg-warning "ignoring return value" "" { target c++17 } 35 } + // { dg-warning "ignoring return value" "" { target c++11 } 35 } } int diff --git a/libstdc++-v3/testsuite/25_algorithms/find_first_of/concept_check_1.cc b/libstdc++-v3/testsuite/25_algorithms/find_first_of/concept_check_1.cc index a970cd4bd61..33f3b42b9fb 100644 --- a/libstdc++-v3/testsuite/25_algorithms/find_first_of/concept_check_1.cc +++ b/libstdc++-v3/testsuite/25_algorithms/find_first_of/concept_check_1.cc @@ -37,7 +37,7 @@ class2 b; void test01() { std::find_first_of(&a, &a, &b, &b, comp); - // { dg-warning "ignoring return value" "" { target c++17 } 39 } + // { dg-warning "ignoring return value" "" { target c++11 } 39 } } int main() diff --git a/libstdc++-v3/testsuite/25_algorithms/is_permutation/2.cc b/libstdc++-v3/testsuite/25_algorithms/is_permutation/2.cc index ab0610c3295..3561c2e6fbf 100644 --- a/libstdc++-v3/testsuite/25_algorithms/is_permutation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/is_permutation/2.cc @@ -103,7 +103,7 @@ void test02() int arr[] = { 11, 22, 33 }; using namespace std; is_permutation(begin(arr0), end(arr0), begin(arr), end(arr), thrower); - // { dg-warning "ignoring return value" "" { target c++17 } 105 } + // { dg-warning "ignoring return value" "" { target c++11 } 105 } } int main() diff --git a/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/71545.cc b/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/71545.cc index 9f666caa68b..9f50714e3c9 100644 --- a/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/71545.cc +++ b/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/71545.cc @@ -33,5 +33,5 @@ int main() X x[1]; int i[1]; std::lexicographical_compare(x, x+1, i, i+1); - // { dg-warning "ignoring return value" "" { target c++17 } 35 } + // { dg-warning "ignoring return value" "" { target c++11 } 35 } } diff --git a/libstdc++-v3/testsuite/25_algorithms/lower_bound/33613.cc b/libstdc++-v3/testsuite/25_algorithms/lower_bound/33613.cc index fa42b82b721..adb04d3f0a1 100644 --- a/libstdc++-v3/testsuite/25_algorithms/lower_bound/33613.cc +++ b/libstdc++-v3/testsuite/25_algorithms/lower_bound/33613.cc @@ -33,5 +33,5 @@ bool ab(A, B); void test01(A* a, B b) { std::lower_bound(a, a, b, ab); - // { dg-warning "ignoring return value" "" { target c++17 } 35 } + // { dg-warning "ignoring return value" "" { target c++11 } 35 } } diff --git a/libstdc++-v3/testsuite/25_algorithms/lower_bound/debug/irreflexive.cc b/libstdc++-v3/testsuite/25_algorithms/lower_bound/debug/irreflexive.cc index 41a6028e404..d85459a57aa 100644 --- a/libstdc++-v3/testsuite/25_algorithms/lower_bound/debug/irreflexive.cc +++ b/libstdc++-v3/testsuite/25_algorithms/lower_bound/debug/irreflexive.cc @@ -44,5 +44,5 @@ void test01() { A as[] = { 0, 1, 2, 3 }; std::lower_bound(as, as + 4, 1, A_int_comparer()); - // { dg-warning "ignoring return value" "" { target c++17 } 46 } + // { dg-warning "ignoring return value" "" { target c++11 } 46 } } diff --git a/libstdc++-v3/testsuite/25_algorithms/lower_bound/debug/partitioned_neg.cc b/libstdc++-v3/testsuite/25_algorithms/lower_bound/debug/partitioned_neg.cc index bc01d8147fa..34a6dbc2531 100644 --- a/libstdc++-v3/testsuite/25_algorithms/lower_bound/debug/partitioned_neg.cc +++ b/libstdc++-v3/testsuite/25_algorithms/lower_bound/debug/partitioned_neg.cc @@ -36,7 +36,7 @@ void test01() { A as[] = { 0, 1, 2, 0, 2, 3 }; std::lower_bound(as, as + 6, A(1)); - // { dg-warning "ignoring return value" "" { target c++17 } 38 } + // { dg-warning "ignoring return value" "" { target c++11 } 38 } } int diff --git a/libstdc++-v3/testsuite/25_algorithms/lower_bound/debug/partitioned_pred_neg.cc b/libstdc++-v3/testsuite/25_algorithms/lower_bound/debug/partitioned_pred_neg.cc index f860df93940..2e7dec02540 100644 --- a/libstdc++-v3/testsuite/25_algorithms/lower_bound/debug/partitioned_pred_neg.cc +++ b/libstdc++-v3/testsuite/25_algorithms/lower_bound/debug/partitioned_pred_neg.cc @@ -24,7 +24,7 @@ void test01() { int as[] = { 0, 1, 0, 2, 3 }; std::lower_bound(as, as + 5, 1, std::less<int>()); - // { dg-warning "ignoring return value" "" { target c++17 } 26 } + // { dg-warning "ignoring return value" "" { target c++11 } 26 } } diff --git a/libstdc++-v3/testsuite/25_algorithms/minmax/3.cc b/libstdc++-v3/testsuite/25_algorithms/minmax/3.cc index a6620b9fa0d..63607cd4694 100644 --- a/libstdc++-v3/testsuite/25_algorithms/minmax/3.cc +++ b/libstdc++-v3/testsuite/25_algorithms/minmax/3.cc @@ -43,7 +43,7 @@ int compare_counter::count = 0; void test01() { std::minmax({1, 2, 3, 4, 5, 6, 7, 8}, compare_counter()); - // { dg-warning "ignoring return value" "" { target c++17 } 45 } + // { dg-warning "ignoring return value" "" { target c++11 } 45 } // If N is the number of arguments in the minmax function call, // 25.3.7 specifies that at most 3N/2 comparisons are allowed. diff --git a/libstdc++-v3/testsuite/25_algorithms/search/78346.cc b/libstdc++-v3/testsuite/25_algorithms/search/78346.cc index e6f3956b252..18fc946b2f3 100644 --- a/libstdc++-v3/testsuite/25_algorithms/search/78346.cc +++ b/libstdc++-v3/testsuite/25_algorithms/search/78346.cc @@ -109,7 +109,7 @@ test01() { value s[] = { 0, 1, 2, 3, 4, 5 }; std::search(s, s+6, stashing_iterator(s), stashing_iterator(s+4)); - // { dg-warning "ignoring return value" "" { target c++17 } 111 } + // { dg-warning "ignoring return value" "" { target c++11 } 111 } } int diff --git a/libstdc++-v3/testsuite/25_algorithms/search_n/58358.cc b/libstdc++-v3/testsuite/25_algorithms/search_n/58358.cc index 651fd86fc9c..b16e8c186a2 100644 --- a/libstdc++-v3/testsuite/25_algorithms/search_n/58358.cc +++ b/libstdc++-v3/testsuite/25_algorithms/search_n/58358.cc @@ -29,7 +29,7 @@ void test01() int count = 0; std::search_n(a.begin(), a.end(), 10, 1, [&count](int t, int u) { ++count; return t == u; }); - // { dg-warning "ignoring return value" "" { target c++17 } 30 } + // { dg-warning "ignoring return value" "" { target c++11 } 30 } VERIFY( count <= 11 ); } diff --git a/libstdc++-v3/testsuite/25_algorithms/unique/1.cc b/libstdc++-v3/testsuite/25_algorithms/unique/1.cc index 698c370e229..f5e3c976a63 100644 --- a/libstdc++-v3/testsuite/25_algorithms/unique/1.cc +++ b/libstdc++-v3/testsuite/25_algorithms/unique/1.cc @@ -27,6 +27,6 @@ int main() using namespace std; list<int> menge; unique (menge.begin(), menge.end()); - // { dg-warning "ignoring return value" "" { target c++17 } 29 } + // { dg-warning "ignoring return value" "" { target c++11 } 29 } return 0; } diff --git a/libstdc++-v3/testsuite/25_algorithms/unique/11480.cc b/libstdc++-v3/testsuite/25_algorithms/unique/11480.cc index a008fc57f54..8c11b4c429d 100644 --- a/libstdc++-v3/testsuite/25_algorithms/unique/11480.cc +++ b/libstdc++-v3/testsuite/25_algorithms/unique/11480.cc @@ -31,7 +31,7 @@ bool compare(int a, int b) // libstdc++/11480 void test01() { - std::unique(a, a+10, compare); // { dg-warning "ignoring return value" "" { target c++17 } } + std::unique(a, a+10, compare); // { dg-warning "ignoring return value" "" { target c++11 } } VERIFY( compare_count == 9 ); } diff --git a/libstdc++-v3/testsuite/25_algorithms/upper_bound/33613.cc b/libstdc++-v3/testsuite/25_algorithms/upper_bound/33613.cc index 19453a38f51..e9eabef5a53 100644 --- a/libstdc++-v3/testsuite/25_algorithms/upper_bound/33613.cc +++ b/libstdc++-v3/testsuite/25_algorithms/upper_bound/33613.cc @@ -33,5 +33,5 @@ bool ba(B, A); void test01(A* a, B b) { std::upper_bound(a, a, b, ba); - // { dg-warning "ignoring return value" "" { target c++17 } 35 } + // { dg-warning "ignoring return value" "" { target c++11 } 35 } } diff --git a/libstdc++-v3/testsuite/25_algorithms/upper_bound/debug/partitioned_neg.cc b/libstdc++-v3/testsuite/25_algorithms/upper_bound/debug/partitioned_neg.cc index 630357d6a45..a48a8261ef6 100644 --- a/libstdc++-v3/testsuite/25_algorithms/upper_bound/debug/partitioned_neg.cc +++ b/libstdc++-v3/testsuite/25_algorithms/upper_bound/debug/partitioned_neg.cc @@ -36,7 +36,7 @@ void test01() { A as[] = { 0, 2, 1, 3, 4, 5 }; std::upper_bound(as, as + 6, A(1)); - // { dg-warning "ignoring return value" "" { target c++17 } 38 } + // { dg-warning "ignoring return value" "" { target c++11 } 38 } } int diff --git a/libstdc++-v3/testsuite/25_algorithms/upper_bound/debug/partitioned_pred_neg.cc b/libstdc++-v3/testsuite/25_algorithms/upper_bound/debug/partitioned_pred_neg.cc index 5beab7d22d7..3e69a24af02 100644 --- a/libstdc++-v3/testsuite/25_algorithms/upper_bound/debug/partitioned_pred_neg.cc +++ b/libstdc++-v3/testsuite/25_algorithms/upper_bound/debug/partitioned_pred_neg.cc @@ -24,7 +24,7 @@ void test01() { int as[] = { 0, 2, 1, 3, 4 }; std::upper_bound(as, as + 5, 1, std::less<int>()); - // { dg-warning "ignoring return value" "" { target c++17 } 26 } + // { dg-warning "ignoring return value" "" { target c++11 } 26 } } diff --git a/libstdc++-v3/testsuite/27_io/ios_base/types/fmtflags/bitmask_operators.cc b/libstdc++-v3/testsuite/27_io/ios_base/types/fmtflags/bitmask_operators.cc index 604d2aa6b5a..3cf8ebe9c46 100644 --- a/libstdc++-v3/testsuite/27_io/ios_base/types/fmtflags/bitmask_operators.cc +++ b/libstdc++-v3/testsuite/27_io/ios_base/types/fmtflags/bitmask_operators.cc @@ -27,7 +27,7 @@ int main() { __gnu_test::bitmask_operators<std::ios_base::fmtflags>(); } -// { dg-warning "ignoring return value.*operator\\|" "" { target c++17 } 0 } -// { dg-warning "ignoring return value.*operator&" "" { target c++17 } 0 } -// { dg-warning "ignoring return value.*operator\\^" "" { target c++17 } 0 } -// { dg-warning "ignoring return value.*operator~" "" { target c++17 } 0 } +// { dg-warning "ignoring return value.*operator\\|" "" { target c++11 } 0 } +// { dg-warning "ignoring return value.*operator&" "" { target c++11 } 0 } +// { dg-warning "ignoring return value.*operator\\^" "" { target c++11 } 0 } +// { dg-warning "ignoring return value.*operator~" "" { target c++11 } 0 } diff --git a/libstdc++-v3/testsuite/27_io/ios_base/types/iostate/bitmask_operators.cc b/libstdc++-v3/testsuite/27_io/ios_base/types/iostate/bitmask_operators.cc index a98435867ed..d6580bb0e70 100644 --- a/libstdc++-v3/testsuite/27_io/ios_base/types/iostate/bitmask_operators.cc +++ b/libstdc++-v3/testsuite/27_io/ios_base/types/iostate/bitmask_operators.cc @@ -27,7 +27,7 @@ int main() { __gnu_test::bitmask_operators<std::ios_base::iostate>(); } -// { dg-warning "ignoring return value.*operator\\|" "" { target c++17 } 0 } -// { dg-warning "ignoring return value.*operator&" "" { target c++17 } 0 } -// { dg-warning "ignoring return value.*operator\\^" "" { target c++17 } 0 } -// { dg-warning "ignoring return value.*operator~" "" { target c++17 } 0 } +// { dg-warning "ignoring return value.*operator\\|" "" { target c++11 } 0 } +// { dg-warning "ignoring return value.*operator&" "" { target c++11 } 0 } +// { dg-warning "ignoring return value.*operator\\^" "" { target c++11 } 0 } +// { dg-warning "ignoring return value.*operator~" "" { target c++11 } 0 } diff --git a/libstdc++-v3/testsuite/27_io/ios_base/types/openmode/bitmask_operators.cc b/libstdc++-v3/testsuite/27_io/ios_base/types/openmode/bitmask_operators.cc index 6d024217362..9a94d9b145a 100644 --- a/libstdc++-v3/testsuite/27_io/ios_base/types/openmode/bitmask_operators.cc +++ b/libstdc++-v3/testsuite/27_io/ios_base/types/openmode/bitmask_operators.cc @@ -27,7 +27,7 @@ int main() { __gnu_test::bitmask_operators<std::ios_base::openmode>(); } -// { dg-warning "ignoring return value.*operator\\|" "" { target c++17 } 0 } -// { dg-warning "ignoring return value.*operator&" "" { target c++17 } 0 } -// { dg-warning "ignoring return value.*operator\\^" "" { target c++17 } 0 } -// { dg-warning "ignoring return value.*operator~" "" { target c++17 } 0 } +// { dg-warning "ignoring return value.*operator\\|" "" { target c++11 } 0 } +// { dg-warning "ignoring return value.*operator&" "" { target c++11 } 0 } +// { dg-warning "ignoring return value.*operator\\^" "" { target c++11 } 0 } +// { dg-warning "ignoring return value.*operator~" "" { target c++11 } 0 } diff --git a/libstdc++-v3/testsuite/ext/concept_checks.cc b/libstdc++-v3/testsuite/ext/concept_checks.cc index abb43a4fade..016600461bf 100644 --- a/libstdc++-v3/testsuite/ext/concept_checks.cc +++ b/libstdc++-v3/testsuite/ext/concept_checks.cc @@ -73,10 +73,10 @@ test2054( ) upper_bound(Index.begin(), Index.end(), SearchTerm, aComparison); equal_range(Index.begin(), Index.end(), SearchTerm, aComparison); binary_search(Index.begin(), Index.end(), SearchTerm, aComparison); - // { dg-warning "ignoring return value" "" { target c++17 } 72 } - // { dg-warning "ignoring return value" "" { target c++17 } 73 } - // { dg-warning "ignoring return value" "" { target c++17 } 74 } - // { dg-warning "ignoring return value" "" { target c++17 } 75 } + // { dg-warning "ignoring return value" "" { target c++11 } 72 } + // { dg-warning "ignoring return value" "" { target c++11 } 73 } + // { dg-warning "ignoring return value" "" { target c++11 } 74 } + // { dg-warning "ignoring return value" "" { target c++11 } 75 } } int main() diff --git a/libstdc++-v3/testsuite/ext/is_heap/47709.cc b/libstdc++-v3/testsuite/ext/is_heap/47709.cc index 50bbccaf725..64966d60317 100644 --- a/libstdc++-v3/testsuite/ext/is_heap/47709.cc +++ b/libstdc++-v3/testsuite/ext/is_heap/47709.cc @@ -24,6 +24,5 @@ void foo() { std::vector<int> v; - is_heap(v.begin(), v.end()); - // { dg-warning "ignoring return value" "" { target c++17 } 27 } + is_heap(v.begin(), v.end()); // { dg-warning "ignoring return value" } } diff --git a/libstdc++-v3/testsuite/ext/is_sorted/cxx0x.cc b/libstdc++-v3/testsuite/ext/is_sorted/cxx0x.cc index 3592d68bfcf..31672481ad8 100644 --- a/libstdc++-v3/testsuite/ext/is_sorted/cxx0x.cc +++ b/libstdc++-v3/testsuite/ext/is_sorted/cxx0x.cc @@ -23,6 +23,5 @@ void foo() { std::vector<int> v; - is_sorted(v.begin(), v.end()); - // { dg-warning "ignoring return value" "" { target c++17 } 26 } + is_sorted(v.begin(), v.end()); // { dg-warning "ignoring return value" } } -- 2.47.0