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

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Patrick Palka
<ppa...@gcc.gnu.org>:

https://gcc.gnu.org/g:70cea067dd2b101edc6b3710678529eb8ba2eec2

commit r14-11177-g70cea067dd2b101edc6b3710678529eb8ba2eec2
Author: Patrick Palka <ppa...@redhat.com>
Date:   Thu Jan 9 10:50:12 2025 -0500

    c++: constexpr potentiality of CAST_EXPR [PR117925]

    We're incorrectly treating the templated callee (FnPtr)fnPtr, represented
    as CAST_EXPR with TREE_LIST operand, as potentially constant here due to
    neglecting to look through the TREE_LIST in the CAST_EXPR case of p_c_e_1.

            PR c++/117925

    gcc/cp/ChangeLog:

            * constexpr.cc (potential_constant_expression_1) <case CAST_EXPR>:
            Fix check for class conversion to literal type to properly look
            through the TREE_LIST operand of a CAST_EXPR.

    gcc/testsuite/ChangeLog:

            * g++.dg/template/non-dependent35.C: New test.

    Reviewed-by: Jason Merrill <ja...@redhat.com>
    (cherry picked from commit 76d1061237b5cd57a274cd8bc8fe02a6f407baa9)

Reply via email to