This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/17012] std::list's function, remove, looks like it is reading memory that has been freed.
- From: "debrak at sgi dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Aug 2004 21:07:14 -0000
- Subject: [Bug libstdc++/17012] std::list's function, remove, looks like it is reading memory that has been freed.
- References: <20040812195652.17012.debrak@sgi.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From debrak at sgi dot com 2004-08-12 21:07 -------
My compile does not work if I replace var.remove(*i0) with var.erase(i0):
% gcc -g -Wall -o bug1.o -c bug1.cpp
bug1.cpp: In function `int main()':
bug1.cpp:22: error: no matching function for call to `std::list<int,
std::allocator<int> >::remove(std::_List_iterator<int>&)'
/usr/local/gcc-3.4.1/lib/gcc/i686-pc-linux-gnu/3.4.1/../../../../include/c++/3.4.1/bits/list.tcc:174:
note: candidates are: void std::list<_Tp, _Alloc>::remove(const _Tp&) [with _Tp
= int, _Alloc = std::allocator<int>]
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17012