[Bug c++/40192] New: Unable to use std::vector with typedef'd array types
coleb at eyesopen dot com
gcc-bugzilla@gcc.gnu.org
Mon May 18 21:06:00 GMT 2009
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
More information about the Gcc-bugs
mailing list