From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ADA253858405; Wed, 23 Mar 2022 12:17:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ADA253858405 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/105027] Missing constraints on std::bit_cast Date: Wed, 23 Mar 2022 12:17:36 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.3 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2022 12:17:36 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105027 --- Comment #4 from CVS Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:4894d69a1f37d54b6a612e58053db477ff5ba832 commit r12-7781-g4894d69a1f37d54b6a612e58053db477ff5ba832 Author: Jonathan Wakely Date: Wed Mar 23 09:57:20 2022 +0000 libstdc++: Add missing constraints to std::bit_cast [PR105027] Our std::bit_cast was relying on the compiler to check for errors inside __builtin_bit_cast, instead of checking them as constraints. That means std::bit_cast was not SFINAE-friendly. This fix uses a requires-clause, so for old versions of Clang without concepts support the function will still be unconstrained. At some point in future we can remove the #ifdef __cpp_concepts check and rely on all compilers having full concepts support in C++20 mode. libstdc++-v3/ChangeLog: PR libstdc++/105027 * include/std/bit (bit_cast): Add constraints. * testsuite/26_numerics/bit/bit.cast/105027.cc: New test.=