------- Comment #10 from igodard at pacbell dot net 2010-08-29 18:00 ------- I agree that Nelson's proposal (in particular 5.17p1 -assignment and compound assignment operators) defines the ordering as: - evaluation of operands - assignment - evaluation of assignment expression i.e. evaluating result of (a|=b) for use in another expression
However you beg the question because you assume that "evaluation of operands" means "evaluation of rvalues derived from the operands". It does not; it means evaluation of an lvalue (i.e. a reference) and an rvalue respectively, because otherwise the assignment would not have an lvalue to assign to. Hence the function f() must be called before "|=" (the assignment) is performed. I have left the report as "Resolved Invalid" because I'm sure that you are sick of me reopening it. However, that there is such a disagreement on the language semantics suggests that Nelson's wording is unclear at best and ambiguous at worse, and I have sent him a note to that effect. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45437