From: Patrick Palka Date: Thu, 12 Feb 2026 20:14:11 +0000 (-0500) Subject: c++: adjust comment from previous commit r16-7487 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26713009e1ecef4ed0fc87e21a61fe0d4c1fe344;p=thirdparty%2Fgcc.git c++: adjust comment from previous commit r16-7487 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) : Adjust r16-7487 comment. --- diff --git a/gcc/cp/cp-gimplify.cc b/gcc/cp/cp-gimplify.cc index 2e2f328079a..cf25cbe2eef 100644 --- a/gcc/cp/cp-gimplify.cc +++ b/gcc/cp/cp-gimplify.cc @@ -923,8 +923,9 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p) 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)