public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/40192]  New: Unable to use std::vector with typedef'd array types
@ 2009-05-18 21:06 coleb at eyesopen dot com
  2009-05-18 22:34 ` [Bug c++/40192] [4.4/4.5 Regression] " paolo dot carlini at oracle dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: coleb at eyesopen dot com @ 2009-05-18 21:06 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1460 bytes --]

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


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2009-05-19 18:19 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-18 21:06 [Bug c++/40192] New: Unable to use std::vector with typedef'd array types coleb at eyesopen dot com
2009-05-18 22:34 ` [Bug c++/40192] [4.4/4.5 Regression] " paolo dot carlini at oracle dot com
2009-05-18 23:16 ` paolo at gcc dot gnu dot org
2009-05-18 23:17 ` paolo at gcc dot gnu dot org
2009-05-18 23:18 ` paolo dot carlini at oracle dot com
2009-05-19 16:36 ` jeff at schwabcenter dot com
2009-05-19 16:42 ` paolo dot carlini at oracle dot com
2009-05-19 17:09 ` jeff at schwabcenter dot com
2009-05-19 17:12 ` paolo dot carlini at oracle dot com
2009-05-19 17:33 ` jeff at schwabcenter dot com
2009-05-19 17:38 ` paolo dot carlini at oracle dot com
2009-05-19 17:58 ` coleb at eyesopen dot com
2009-05-19 18:07 ` jeff at schwabcenter dot com
2009-05-19 18:19 ` paolo dot carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).