c++: evaluation order of xobj memfn call [PR123989]

The object argument of an xobj memfn call needs to be evaluated before its
formal arguments, like with an iobj memfn call.  This patch generalizes the
existing such handling in cp_gimplify_expr for METHOD_TYPE callees to also
accept xobj memfn callees.

	PR c++/123989

gcc/cp/ChangeLog:

	* cp-gimplify.cc (cp_gimplify_expr) <case CALL_EXPR>: Evaluate
	the object argument of an xobj memfn call first too.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp23/explicit-obj-eval-order.C: New test.

Reviewed-by: Marek Polacek <polacek@redhat.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
(cherry picked from commit 0d51ed19504bcaa540763423763bb97227ed6c1c)
2 files changed