https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113640
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>: https://gcc.gnu.org/g:0857a00fe3226db8801384743b6d44353dcac9da commit r14-8631-g0857a00fe3226db8801384743b6d44353dcac9da Author: Patrick Palka <ppa...@redhat.com> Date: Tue Jan 30 10:44:56 2024 -0500 c++: duplicated side effects of xobj arg [PR113640] We miscompile the below testcase because keep_unused_object_arg thinks the object argument of an xobj member function is unused, and so it ends up duplicating the argument's side effects. PR c++/113640 gcc/cp/ChangeLog: * call.cc (keep_unused_object_arg): Punt for an xobj member function. gcc/testsuite/ChangeLog: * g++.dg/cpp23/explicit-obj-lambda14.C: New test. Reviewed-by: Jason Merrill <ja...@redhat.com>