From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 619DF3858C41; Wed, 28 Jun 2023 15:23:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 619DF3858C41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687965816; bh=15ItDEPq/VkqRzr6pIY/m26MNmvCRuqNEyCH0987ThI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gcIRDdtLymnRIzuUh4r7rDaRl1CMctYx6l8X73w07mcBo3chGGJbyOWqM++BLIRC7 dotmZeaCbAdU4nGG7DpNfkCky1Cpy93XlkOFBqmL5Ad8b4+wjb1OwcqdGnKea3YIdW 89pk+0kVt6/b/uhP3mcj2aFzF0LGi0Q4JorENhfY= From: "matt.cross+gcc-bugzilla at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/110441] c++17: temporary causes static member function call to confuse required copy elision Date: Wed, 28 Jun 2023 15:23:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: matt.cross+gcc-bugzilla at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110441 Matt Cross changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |matt.cross+gcc-bugzilla@gma | |il.com --- Comment #5 from Matt Cross -= -- I have also found that * Making the function f() non-static works. https://godbolt.org/z/jn6Ms1n5h * Making a unique_ptr to an S fails: "auto sp =3D std::make_unique(); re= turn sp->f();" https://godbolt.org/z/85e9MW91b I suspect it is the same root cause, but just in case there's wrinkles here= I thought these additional test cases might be helpful.=