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

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Simon Martin <simar...@gcc.gnu.org>:

https://gcc.gnu.org/g:4e4c378ac1f923a310fa31be85ed8c0c50e9f5ef

commit r15-7096-g4e4c378ac1f923a310fa31be85ed8c0c50e9f5ef
Author: Simon Martin <si...@nasilyan.com>
Date:   Tue Jan 21 13:31:41 2025 +0100

    c++: Don't ICE in build_class_member_access_expr during error recovery
[PR118225]

    The invalid case in this PR trips on an assertion in
    build_class_member_access_expr that build_base_path would never return
    an error_mark_node, which is actually incorrect if the object involves a
    tree with an error_mark_node DECL_INITIAL, like here.

    This patch changes the assert to not fire if an error has been reported.

            PR c++/118225

    gcc/cp/ChangeLog:

            * typeck.cc (build_class_member_access_expr): Let errors that
            that have been reported go through.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp0x/constexpr-ice21.C: New test.

Reply via email to