This is the mail archive of the libstdc++@sources.redhat.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Mixing complex numbers and ints


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
------------------------------------- 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]