[gcc r16-7488] c++: adjust comment from previous commit r16-7487

Patrick Palka ppalka@gcc.gnu.org
Thu Feb 12 20:15:02 GMT 2026


https://gcc.gnu.org/g:26713009e1ecef4ed0fc87e21a61fe0d4c1fe344

commit r16-7488-g26713009e1ecef4ed0fc87e21a61fe0d4c1fe344
Author: Patrick Palka <ppalka@redhat.com>
Date:   Thu Feb 12 15:14:11 2026 -0500

    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) <case CALL_EXPR>: Adjust
            r16-7487 comment.

Diff:
---
 gcc/cp/cp-gimplify.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gcc/cp/cp-gimplify.cc b/gcc/cp/cp-gimplify.cc
index 2e2f328079a8..cf25cbe2eefb 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)


More information about the Gcc-cvs mailing list