Re: C++ order of evaluation of operands, arguments

2015-11-29 Thread Jason Merrill
On 11/25/2015 01:25 PM, Martin Sebor wrote: On 11/24/2015 02:55 AM, Andrew Haley wrote: On 23/11/15 23:01, Jason Merrill wrote: There's a proposal working through the C++ committee to define the order of evaluation of subexpressions that previously had unspecified ordering:

Re: C++ order of evaluation of operands, arguments

2015-11-26 Thread David Brown
On 25/11/15 15:47, Michael Matz wrote: > Hi, > > On Tue, 24 Nov 2015, Richard Biener wrote: > >> On Tue, Nov 24, 2015 at 12:01 AM, Jason Merrill wrote: >>> There's a proposal working through the C++ committee to define the order of >>> evaluation of subexpressions that

Re: C++ order of evaluation of operands, arguments

2015-11-26 Thread Michael Matz
Hi, On Thu, 26 Nov 2015, David Brown wrote: > That is all true - but if you have to pick an order that makes sense to > users, especially of functions that are not varargs (i.e., most > functions), then left-to-right is the only logical, natural order - at > least for those of use who use

Re: C++ order of evaluation of operands, arguments

2015-11-25 Thread Martin Sebor
On 11/24/2015 02:55 AM, Andrew Haley wrote: On 23/11/15 23:01, Jason Merrill wrote: There's a proposal working through the C++ committee to define the order of evaluation of subexpressions that previously had unspecified ordering:

Re: C++ order of evaluation of operands, arguments

2015-11-25 Thread Paul_Koning
> On Nov 25, 2015, at 1:25 PM, Martin Sebor wrote: > > On 11/24/2015 02:55 AM, Andrew Haley wrote: >> On 23/11/15 23:01, Jason Merrill wrote: >>> There's a proposal working through the C++ committee to define the order >>> of evaluation of subexpressions that previously had

Re: C++ order of evaluation of operands, arguments

2015-11-25 Thread Andrew Haley
On 11/25/2015 06:25 PM, Martin Sebor wrote: > The motivating example in the paper suggests that many C++ > programmers expect a left to right order of evaluation here > due to the commonality of constructs like chains of calls. Sure, I often see foo.bar(1).bar(2).bar(3), etc. but does anyone

Re: C++ order of evaluation of operands, arguments

2015-11-25 Thread Martin Sebor
On 11/25/2015 11:49 AM, Andrew Haley wrote: On 11/25/2015 06:25 PM, Martin Sebor wrote: The motivating example in the paper suggests that many C++ programmers expect a left to right order of evaluation here due to the commonality of constructs like chains of calls. Sure, I often see

Re: C++ order of evaluation of operands, arguments

2015-11-25 Thread Jonathan Wakely
On 25 November 2015 at 19:38, wrote: > I'm really wondering about this proposal. It seems that it could affect > optimization. It also seems to be a precedent that may not be a good one to > set. Consider the dozen or so "undefined behavior" examples in >

Re: C++ order of evaluation of operands, arguments

2015-11-25 Thread Michael Matz
Hi, On Tue, 24 Nov 2015, Richard Biener wrote: > On Tue, Nov 24, 2015 at 12:01 AM, Jason Merrill wrote: > > There's a proposal working through the C++ committee to define the order of > > evaluation of subexpressions that previously had unspecified ordering: > > > >

Re: C++ order of evaluation of operands, arguments

2015-11-24 Thread Eric Botcazou
> In addition, I don't see anything about C compatibility here. It > would be very confusing, to say the least, if this were to be defined > in C++ but not C. Or at least they should get some form of guarantee that future C standards will not introduce incompatible rules. -- Eric Botcazou

Re: C++ order of evaluation of operands, arguments

2015-11-24 Thread Richard Biener
On Tue, Nov 24, 2015 at 12:01 AM, Jason Merrill wrote: > There's a proposal working through the C++ committee to define the order of > evaluation of subexpressions that previously had unspecified ordering: > > http://www.open-std.org/Jtc1/sc22/wg21/docs/papers/2015/p0145r0.pdf >

Re: C++ order of evaluation of operands, arguments

2015-11-24 Thread Andrew Haley
On 23/11/15 23:01, Jason Merrill wrote: > There's a proposal working through the C++ committee to define the order > of evaluation of subexpressions that previously had unspecified ordering: > > http://www.open-std.org/Jtc1/sc22/wg21/docs/papers/2015/p0145r0.pdf > > I agree with much of this,

Re: C++ order of evaluation of operands, arguments

2015-11-24 Thread Martin Sebor
On 11/23/2015 04:01 PM, Jason Merrill wrote: There's a proposal working through the C++ committee to define the order of evaluation of subexpressions that previously had unspecified ordering: http://www.open-std.org/Jtc1/sc22/wg21/docs/papers/2015/p0145r0.pdf I agree with much of this, but was

C++ order of evaluation of operands, arguments

2015-11-23 Thread Jason Merrill
There's a proposal working through the C++ committee to define the order of evaluation of subexpressions that previously had unspecified ordering: http://www.open-std.org/Jtc1/sc22/wg21/docs/papers/2015/p0145r0.pdf I agree with much of this, but was concerned about the proposal to define