GCC Bugzilla – Bug 5724
Evaluation order of parameters for multiple operator<< calls
Last modified: 2004-08-13 16:03:36 UTC
I have an example where
cout << f(a) << f(b);
is calling f(b) before f(a), which I think is wrong. The operator<< is (in this case) a function call, so there should be a sequence point which guarantees evaluation order.
My apologies for submitting a bug on an old version.
Cygwin on Windows 2000
g++ gccseqtest.cc -o gccseqtest
I think this should be:
State-Changed-Why: no, there is no sequence point there. The code is
output (output (cout, f (a)), f (b));
where 'output' is the operator<< function. you'll see
that 'f (b)' can be called before or after
'output (cout, f (a))'
From: Graham Stott <firstname.lastname@example.org>
Subject: Re: c++/5724: Evaluation order of parameters for multiple operator<<
Date: Mon, 18 Feb 2002 20:18:34 +0000
Please supply a complete testcase.
Reopening to mark as a duplicate of...
*** This bug has been marked as a duplicate of 11751 ***