The comment from r16-7487 is confused, the object argument of PMF
calls _must_ be sequenced first by [expr.call]/7 since syntactically
it appears in the postfix-expression: (a.*pmf)(...).
It's indirect calls to a (known) xobj memfn that don't need such
sequencing, since syntactically the object argument isn't in the
postfix-expression: (&A::f)(a, ...).
gcc/cp/ChangeLog:
* cp-gimplify.cc (cp_gimplify_expr) <case CALL_EXPR>: Adjust
r16-7487 comment.
fntype = TREE_TYPE (fntype);
tree decl = cp_get_callee_fndecl_nofold (*expr_p);
/* We can't just rely on 'decl' because virtual function callees
- are expressed as OBJ_TYPE_REF. Though checking for METHOD_TYPE
- means we'll also sequence PMF calls, which is allowed under
+ are expressed as OBJ_TYPE_REF. Note that the xobj memfn check
+ will also hold for calls of the form (&A::f)(a, ...) which does
+ not require such sequencing, though it's allowed under
"indeterminately sequenced". */
if (TREE_CODE (fntype) == METHOD_TYPE
|| (decl && DECL_LANG_SPECIFIC (decl)