The following code will not compile in gcc 4.3.2 on Ubuntu 8.10

#include <vector>

typedef float float4[4];

int main()
{
  std::vector<float4> vals;
}

I get the following compilation error:
/usr/include/c++/4.3/bits/stl_construct.h: In function ‘void
std::_Destroy(_Tp*) [with _Tp = float [4]]’:
/usr/include/c++/4.3/bits/stl_construct.h:103:   instantiated from ‘void
std::_Destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator =
float (*)[4]]’
/usr/include/c++/4.3/bits/stl_construct.h:128:   instantiated from ‘void
std::_Destroy(_ForwardIterator, _ForwardIterator, std::allocator<_T2>&) [with
_ForwardIterator = float (*)[4], _Tp = float [4]]’
/usr/include/c++/4.3/bits/stl_vector.h:300:   instantiated from
‘std::vector<_Tp, _Alloc>::~vector() [with _Tp = float [4], _Alloc =
std::allocator<float [4]>]’
test_float4.cpp:7:   instantiated from here
/usr/include/c++/4.3/bits/stl_construct.h:88: error: request for member ‘~float
[4]’ in ‘* __pointer’, which is of non-class type ‘float [4]’

The code does compile in gcc 3.4 and gcc 4.1.


-- 
           Summary: Unable to use std::vector with typedef'd array types
           Product: gcc
           Version: 4.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: coleb at eyesopen dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40192

Reply via email to