(970929) c++ type matching bug?

Mumit Khan khan@xraylith.wisc.edu
Wed Oct 1 10:35:00 GMT 1997


The following code does not work with 970929 (did with previous releases):

========
#include <complex>

void foo() {
    complex<double> x(0, 0);
    complex<double> y = 1.0 + x;   // OK
    complex<double> z = 1 + x;	   // line 6: <<<< 1 doesn't match double
}
========

% c++ -c cmplx.cc
cmplx.cc: In function `void foo()':
cmplx.cc:6: no match for `int + complex<double> &'

=======

Shouldn't the "z" assignment work?

Regards,
Mumit -- khan@xraylith.wisc.edu
http://www.xraylith.wisc.edu/~khan/



More information about the Gcc-bugs mailing list