This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Remove testsuite/23_containers/map/operators/1.cc ?
- From: François Dumont <frs dot dumont at gmail dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>, Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Date: Thu, 05 Jun 2014 22:36:02 +0200
- Subject: Re: Remove testsuite/23_containers/map/operators/1.cc ?
- Authentication-results: sourceware.org; auth=none
- References: <538F7FE8 dot 2020302 at gmail dot com> <538F8265 dot 3040903 at oracle dot com> <20140604205250 dot GB31471 at redhat dot com>
On 04/06/2014 22:52, Jonathan Wakely wrote:
On 04/06/14 22:32 +0200, Paolo Carlini wrote:
Hi,
On 06/04/2014 10:22 PM, François Dumont wrote:
Hello
Do you see any objection in removing this file ? It doesn't look
like a test at all to me, just send some datas to std::cerr. There
is also a weird comment talking about multiset while code is using map.
The comment seems a pasto, which should be fixed. Likewise the uses
of the inserters should be either turned into VERIFYs or alternately
the testcase changed to do-compile (the original issue was a
compile-time issue, but years ago we used to mostly add to the
library testsuite do-run testcases). Indeed, we could also move it to
where the other insert tests are (I think the reason of the weird
directory has to do with the semantics of the operator[] in C++98).
It looks like it only needs to do this, as a compile-only test:
typedef std::map<int,const int> MapInt;
MapInt m;
for (MapInt::const_iterator i=m.begin();i!=m.end();++i)
{ }
for (MapInt::const_iterator i=m.begin();m.end()!=i;++i)
{ }
The bug that it tests was in iterator comparisons:
https://gcc.gnu.org/ml/libstdc++/2000-11/msg00093.html
Ok, I checked the PR too and simplified the test.
Can I commit this ?
Shall I add a ChangeLog entry for such a simple modification ?
François
Index: testsuite/23_containers/map/operators/1.cc
===================================================================
--- testsuite/23_containers/map/operators/1.cc (revision 211288)
+++ testsuite/23_containers/map/operators/1.cc (working copy)
@@ -1,3 +1,5 @@
+// { dg-do compile }
+
// 2000-09-07 bgarcia@laurelnetworks.com
// Copyright (C) 2000-2014 Free Software Foundation, Inc.
@@ -17,17 +19,15 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 23.3.4 template class multiset
+// 23.4.4 template class map
#include <map>
-#include <string>
-#include <iostream>
// libstdc++/737
// http://gcc.gnu.org/ml/libstdc++/2000-11/msg00093.html
void test02()
{
- typedef std::map<int, int> MapInt;
+ typedef std::map<int, const int> MapInt;
MapInt m;
@@ -35,10 +35,10 @@
m.insert(MapInt::value_type(i,i));
for (MapInt::const_iterator i = m.begin(); i != m.end(); ++i)
- std::cerr << i->second << ' ';
+ { }
for (MapInt::const_iterator i = m.begin(); m.end() != i; ++i)
- std::cerr << i->second << ' ';
+ { }
}
int main()