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

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

https://gcc.gnu.org/g:76d1061237b5cd57a274cd8bc8fe02a6f407baa9

commit r15-6739-g76d1061237b5cd57a274cd8bc8fe02a6f407baa9
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>

Reply via email to