[Bug c++/41480] New: std::map.erase on cygwin
lifelong830114 at gmail dot com
gcc-bugzilla@gcc.gnu.org
Sun Sep 27 07:31:00 GMT 2009
The program goto endless loops when run erase() in a for loop,as fallows:
#include <map>
#include <stdio.h>
std::map<int , int> mymap;
int main() {
mymap[2] =3 ;
mymap[1] = 4;
printf("**********test map.erase*********\n");
std::map<int,int>::iterator it;
it = mymap.begin();
for (; it != mymap.end() ; it++) {
mymap.erase((*it).first);
}
return 0;
}
I have try to delete the line "printf("**********test
map.erase*********\n");",then it worked correctly!
The configure string is :
./configure --prefix=/usr/local/gcc-4.2.0 --program-suffix=-420
--enable-language=c,c++
--
Summary: std::map.erase on cygwin
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: lifelong830114 at gmail dot com
GCC build triplet: i686-pc-cygwin
GCC host triplet: i686-pc-cygwin
GCC target triplet: i686-pc-cygwin
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41480
More information about the Gcc-bugs
mailing list