This is the mail archive of the
mailing list for the GCC project.
[Bug middle-end/23497] [4.1 regression] Bogus 'is used uninitialized...' warning about std::complex<T>
- From: "mmitchel at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Nov 2005 19:23:12 -0000
- Subject: [Bug middle-end/23497] [4.1 regression] Bogus 'is used uninitialized...' warning about std::complex<T>
- References: <email@example.com/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #14 from mmitchel at gcc dot gnu dot org 2005-11-15 19:23 -------
There is nothing wrong with the code in Comment #1; __imag__ is an
lvalue-yielding operator. If, for some reason, we wanted to make __imag__
yield an rvalue, then this code would be rejected with an error; under no
circumstances should it yield a warning about the complex value being
uninitialized upon initialization of its imaginary component. It would be
reasonable to warn about a subsequent use of the complex value, as the real
part remains uninitialized.
Andrew's comments about the fact that __complex__ is a scalar are irrelevant.