This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/64870] value not set via reference
- From: "conradsand.arma at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 30 Jan 2015 08:05:28 +0000
- Subject: [Bug c++/64870] value not set via reference
- Auto-submitted: auto-generated
- References: <bug-64870-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64870
--- Comment #6 from Conrad <conradsand.arma at gmail dot com> ---
(In reply to Andrew Pinski from comment #5)
> No, that is not how C++ defines it. As mentioned before C++ does not define
> the order of the execution of the operands.
I agree this is not how C++ defines it. At the same time, changing the order
from left-to-right "just because we can" is not a good strategy either,
especially for iostreams.
> There is no wtf moments. This is not Java which has well defined behavior
> :).
Ha :-) I'd still like to see some concrete benchmarks to support re-ordering.
Otherwise it can be argued that the re-ordering is actually counter productive,
given its unintuitive behaviour.
Given a choice between gcc and clang, I'd pick clang because it's simply better
behaved. This is not to dismiss the great effort put into gcc, but
user-friendliness is important.