From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 458333858D28; Fri, 24 Mar 2023 20:43:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 458333858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679690621; bh=gfGytv4OrXAMxzKC7dE/RLbaXvHkZbQhiByV/qkXzbM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nPnXxAw+/wIsfIocKtwwKIQVAXavFYACnuOZvf2Qke/4JKWPo9eMUEmpo3/ufKYl8 pNsrVhpVXhb8hrndeBXju8fjhvG1pH3NR/VmiXcPvhmONwAFEIxu6/ieClr2JZb564 7ivFNZRDCsNyt2FAf/I3ziRQ1iRIYGBkXQbtVD3w= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: =?UTF-8?B?W0J1ZyBjKysvMTA5Mjc3XSBbMTMgUmVncmVzc2lvbl0gdHlwZV90?= =?UTF-8?B?cmFpdHM6MTQxNzozMDogZXJyb3I6IGludmFsaWQgdXNlIG9mIGluY29tcGxl?= =?UTF-8?B?dGUgdHlwZSDigJhjbGFzcyB2ODo6aW50ZXJuYWw6Oldhc21BcnJheeKAmQ==?= Date: Fri, 24 Mar 2023 20:43:41 +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: 13.0 X-Bugzilla-Keywords: needs-bisection, needs-reduction, rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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=3D109277 --- Comment #3 from Andrew Pinski --- Though the code might be undefined ... 20.15.6/5 says: ``` The predicate condition for a template specialization is_convertible shall be satisfied if and only if the return expression in the following code would be well-formed, including any implicit conversions to the return type of the function: To test() { return declval(); } [Note: This requirement gives well-defined results for reference types, void types, array types, and function types. =E2=80=94 end note] Access checking is performed in a context unrela= ted to To and From. Only the validity of the immediate context of the expression of the return statement (8.7.3) (including initialization of the returned object or reference) is considered. [Note: The initialization can result in side effects such as the instantiation of class template specializations and function template specializations, the generation of implicitly-defined functions, and so on. Such side effects are not in the =E2=80=9Cimmediate context=E2=80=9D and can result in the program being ill-formed. =E2=80=94 end note] ``` I am not 100% sure but I suspect this is just ill-formed code which was not rejected before but is now using the builtin rather than the template form = ...=