https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124096

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <[email protected]>:

https://gcc.gnu.org/g:2206271eadd60f14372f87f3afc94632dc0463b1

commit r16-7567-g2206271eadd60f14372f87f3afc94632dc0463b1
Author: Marek Polacek <[email protected]>
Date:   Fri Feb 13 13:46:58 2026 -0500

    c++: bit_cast and consteval-only types [PR124096]

    [bit.cast]/2: Mandates: Neither To nor From are consteval-only types

    but we are not checking this, so the attached test compiled.  I'm
    adding the check into cp_build_bit_cast rather than <bit> so that
    we detect this even for __builtin_bit_cast.

            PR c++/124096

    gcc/cp/ChangeLog:

            * semantics.cc (cp_build_bit_cast): Check that neither argument is
            consteval-only.

    gcc/testsuite/ChangeLog:

            * g++.dg/reflect/bit_cast.C: New test.

    Reviewed-by: Jakub Jelinek <[email protected]>

Reply via email to