This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[v3] libstdc++/40600
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Tue, 30 Jun 2009 14:15:00 +0200
- Subject: [v3] libstdc++/40600
Hi,
tested x86_64-linux, committed mainline and 4_4-branch.
Paolo.
//////////////////
2009-06-30 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/40600
* testsuite/25_algorithms/minmax/2.cc: Fix consistently with
std::minmax return type.
* testsuite/25_algorithms/minmax/3.cc: Likewise.
Index: testsuite/25_algorithms/minmax/2.cc
===================================================================
--- testsuite/25_algorithms/minmax/2.cc (revision 149088)
+++ testsuite/25_algorithms/minmax/2.cc (working copy)
@@ -27,25 +27,25 @@
{
bool test __attribute__((unused)) = true;
- std::pair<const int&, const int&> z = std::minmax({1, 2, 3});
- std::pair<const int&, const int&> w = std::minmax({4, 3, 5, 4});
- std::pair<const int&, const int&> y = std::minmax({4, 5, 3, 7, 3});
+ std::pair<int, int> z = std::minmax({1, 2, 3});
+ std::pair<int, int> w = std::minmax({4, 3, 5, 4});
+ std::pair<int, int> y = std::minmax({4, 5, 3, 7, 3});
VERIFY( z.first == 1 );
VERIFY( z.second == 3 );
VERIFY( w.first == 3 );
VERIFY( w.second == 5 );
VERIFY( y.first == 3 );
VERIFY( y.second == 7 );
-
- std::pair<const int&, const int&> zc =
+
+ std::pair<int, int> zc =
std::minmax({1, 2, 3}, std::greater<int>());
-
- std::pair<const int&, const int&> wc =
+
+ std::pair<int, int> wc =
std::minmax({4, 3, 5, 4}, std::greater<int>());
-
- std::pair<const int&, const int&> yc =
+
+ std::pair<int, int> yc =
std::minmax({4, 5, 3, 7, 3}, std::greater<int>());
-
+
VERIFY( zc.first == 3 );
VERIFY( zc.second == 1 );
VERIFY( wc.first == 5 );
Index: testsuite/25_algorithms/minmax/3.cc
===================================================================
--- testsuite/25_algorithms/minmax/3.cc (revision 149088)
+++ testsuite/25_algorithms/minmax/3.cc (working copy)
@@ -41,8 +41,8 @@
{
bool test __attribute__((unused)) = true;
- std::pair<const int&, const int&> z = std::minmax({1, 2, 3, 4, 5, 6, 7, 8},
- compare_counter());
+ std::pair<int, int> z = std::minmax({1, 2, 3, 4, 5, 6, 7, 8},
+ compare_counter());
// If N is the number of arguments in the minmax function call,
// 25.3.7 specifies that at most 3N/2 comparisons are allowed.