This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17453] New: G++ type conversion bug
- From: "froloff at os2 dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Sep 2004 11:08:58 -0000
- Subject: [Bug c++/17453] New: G++ type conversion bug
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The folowing source produce an error in line 10 during compilation
=====================================================================
test.c: In function `void chk_gcc_bug()':
test.c:7: error: cannot convert `std::vector<_Tp, _Alloc>::begin() [with _Tp =
unsigned char, _Alloc = std::allocator<unsigned char>]()' from type `
__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char,
std::allocator<unsigned char> > >' to type `unsigned char*'
====>8====================================>8=========================
#include <vector>
typedef std::vector<unsigned char> byte_vector;
void chk_gcc_bug()
{
byte_vector v(96 / 8);
unsigned char *ptr;
ptr= (unsigned char *)v.begin();
ptr= &(*(v.begin()));
}
====>8====================================>8=========================
Also check with gcc3.3.3 with the same result
Compiled fine with MSC v7.0
--
Summary: G++ type conversion bug
Product: gcc
Version: 3.2.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: froloff at os2 dot ru
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17453