This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21057] New: iso C99 complex double: problems with g++
- From: "hartmann at physik dot uni-kl dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Apr 2005 12:35:21 -0000
- Subject: [Bug c++/21057] New: iso C99 complex double: problems with g++
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Hallo.
I want to use the ISO C99 complex datatypes in c++ because they are faster than
the template complex types from std++.
g++ fails to work with ISO C99 complex in the following way:
typedefs+built-in-functions(conj)+unary minus are not working well together.
>>>>cat test.cpp
#include </usr/include/complex.h>
typedef complex double zcomplex;
int main()
{
zcomplex f=1+_Complex_I*1;
f=-_Complex_I;
f=conj(f);
return 0;
}
>>>>g++ -Wall test.cpp
test.cpp: In function `int main()':
test.cpp:9: error: wrong type argument to unary minus
test.cpp:11: error: wrong type argument to conjugation
>>>>g++ -v
Reading specs from /usr/lib/gcc-lib/i586-suse-linux/3.3.4/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr
--with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man
--enable-languages=c,c++,f77,objc,java,ada --disable-checking --libdir=/usr/lib
--enable-libgcj --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib
--with-system-zlib --enable-shared --enable-__cxa_atexit i586-suse-linux
Thread model: posix
gcc version 3.3.4 (pre 3.3.5 20040809)
gcc compiles the c-version without problems.
g++-versions 3.3.4,3.4.3(mingw),3.1.x,... are broken.
--
Summary: iso C99 complex double: problems with g++
Product: gcc
Version: 3.3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hartmann at physik dot uni-kl dot de
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21057