This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/17453] New: G++ type conversion bug


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]