[Bug c++/21210] New: STL containers do not accept GNU builtin __complex__ type anymore

loose at astron dot nl gcc-bugzilla@gcc.gnu.org
Mon Apr 25 09:58:00 GMT 2005

The GCC 4.0.0 release does not support the use of the GNU builtin __complex__
anymore in, e.g., std::vector. The code below used to compile on GNU
(compatible) compilers prior to GCC 4.0

#include <vector>
typedef float __complex__ fcomplex;
std::vector<fcomplex> vfc(10);

GCC 4.0.0 produces the following diagnostic:

$ /data/loose/gcc-4.0.0/bin/g++ -v -save-temps -c -Wall -W tVec.cc

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../../src/gcc-4.0.0/configure --prefix=/data/loose/gcc-4.0.0
--enable-threads --enable-__cxa_atexit
Thread model: posix
gcc version 4.0.0
 /data/loose/gcc-4.0.0/libexec/gcc/i686-pc-linux-gnu/4.0.0/cc1plus -E -quiet -v
-D_GNU_SOURCE tVec.cc -mtune=pentiumpro -Wall -W -fpch-preprocess -o tVec.ii
ignoring nonexistent directory
#include "..." search starts here:
#include <...> search starts here:
End of search list.
-fpreprocessed tVec.ii -quiet -dumpbase tVec.cc -mtune=pentiumpro -auxbase tVec
-Wall -W -version -o tVec.s
GNU C++ version 4.0.0 (i686-pc-linux-gnu)
        compiled by GNU C version 4.0.0.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
In constructor ‘std::vector<_Tp, _Alloc>::vector(size_t) [with _Tp = float
__complex__, _Alloc = std::allocator<float __complex__>]Â’:
tVec.cc:3:   instantiated from here
error: invalid cast from type ‘int’ to type ‘float __complex__’

           Summary: STL containers do not accept GNU builtin __complex__
                    type anymore
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: loose at astron dot nl
                CC: gcc-bugs at gcc dot gnu dot org


More information about the Gcc-bugs mailing list