This is the mail archive of the
libstdc++@sources.redhat.com
mailing list for the libstdc++ project.
Mixing complex numbers and ints
- To: gcc at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Subject: Mixing complex numbers and ints
- From: Peter Bienstman <Peter dot Bienstman at rug dot ac dot be>
- Date: Wed, 6 Dec 2000 19:46:01 +0100 (MET)
Hi,
The following program
#include <complex>
int main()
{
std::complex<double> a(1,1);
a + 1;
}
produces
c.cpp: In function `int main()':
c.cpp:6: no match for `std::complex<double>& + int' operator
This worked in 2.95. Using doubles instead of ints does work.
Is this a true regression or just a correct implementation of stricter
promotion rules imposed by the standard?
Thanks,
Peter
>gcc -v
Reading specs from
/home/pbienst/gcc_Exp/bin/../lib/gcc-lib/i686-pc-linux-gnu/2.97/specs
Configured with: ../gcc/configure --prefix=/home/pbienst/gcc_Exp/
--enable-languages=f77,c++
gcc version 2.97 20001128 (experimental)
-------------------------------------
Peter Bienstman
Department of Information Technology
INTEC/IMEC - Ghent University
St.-Pietersnieuwstraat 41
B-9000 Gent - Belgium
E-mail: Peter.Bienstman@rug.ac.be
Tel: +32 9 264 3445
Fax: +32 9 264 3593
-------------------------------------