This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/39678] std::transform is incorrect with std::multiples and bind2nd for complex<float>
- From: "diepen at astron dot nl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Apr 2009 14:03:41 -0000
- Subject: [Bug c++/39678] std::transform is incorrect with std::multiples and bind2nd for complex<float>
- References: <bug-39678-15185@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from diepen at astron dot nl 2009-04-07 14:03 -------
The output does not show the correct results. It looks as if the imaginary part
of the complex number in the bind2nd object is incorrect. When debugging the
bind2nd object was constructed correctly, but when used in std::transform its
value was incorrect, in particular the imaginary part seems to be uninitialized
(as also reported by valgrind). As I said, this only happens for
complex<float>, not for complex<double>.
Originally I used my own Multiplies functor to multiply a float vector with a
complex<float> value and that failed similarly. But it appears to happen for
the simpler case as shown in my test program too.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39678