This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

(970929) c++ type matching bug?


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/


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