]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: adjust comment from previous commit r16-7487
authorPatrick Palka <ppalka@redhat.com>
Thu, 12 Feb 2026 20:14:11 +0000 (15:14 -0500)
committerPatrick Palka <ppalka@redhat.com>
Thu, 12 Feb 2026 20:14:11 +0000 (15:14 -0500)
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.

gcc/cp/cp-gimplify.cc

index 2e2f328079a8a6ebbc7b76ac87c3c8d311bc3cc8..cf25cbe2eefb74fc273898869fbef8001a23070d 100644 (file)
@@ -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)