This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
volatile std::complex<> problem
- From: jhr dot walter at t-online dot de (Joerg Walter)
- To: <libstdc++ at gcc dot gnu dot org>
- Date: Mon, 3 Mar 2003 20:59:42 +0100
- Subject: volatile std::complex<> problem
Hi,
the following program
#include <complex>
int main()
{
std::complex<double> c1, c2;
volatile std::complex<double> c3(c1 + c2); // works fine
volatile std::complex<double> c4;
c4 = c1 + c2; // fails
}
doesn't compile with GCC 3.2.1 (and GCC 2.95.3)
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/specs
Configured with: ./configure
Thread model: posix
gcc version 3.2.1
giving the diagnostic
volatileness.cpp: In function `int main()':
volatileness.cpp:7: passing `volatile std::complex<double>' as `this'
argument
of `std::complex<double>& std::complex<double>::operator=(const
std::complex<double>&)' discards qualifiers
ICC 7.0 and Kylix accept the program. Is this a well known deficiency?
Thanks,
Joerg Walter