This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14340] New: libstdc++ debug mode: failure to convert iterator to const_iterator
- From: "phil dot el at wanadoo dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Feb 2004 03:08:21 -0000
- Subject: [Bug c++/14340] New: libstdc++ debug mode: failure to convert iterator to const_iterator
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
#include <vector>
std::vector<int>::const_iterator find_arc()
{
std::vector<int> v;
std::vector<int>::const_iterator it = v.begin();
std::vector<int>::const_iterator end = v.end();
return it == end ? v.end() : it;
}
g++ -D_GLIBCXX_DEBUG -c debug-mode-1.cpp
debug-mode-1.cpp: In function
`__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<const int*,
__gnu_norm::vector<int, std::allocator<int> > >, __gnu_debug_def::vector<int,
std::allocator<int> > > find_arc()':
debug-mode-1.cpp:10: error: operands to ?: have different types
the type are vector<int>::iterator and vector<int>::const_iterator but
a conversion should occur imho.
regards,
Phil
--
Summary: libstdc++ debug mode: failure to convert iterator to
const_iterator
Product: gcc
Version: tree-ssa
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: phil dot el at wanadoo dot fr
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14340