[Bug c++/96442] [10/11/12/13 Regression] ICE in tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have record_type in int_fits_type_p, at tree.c:8954

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jun 7 06:57:13 GMT 2022


--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Roger Sayle <sayle@gcc.gnu.org>:


commit r13-999-g6dd194e2ce201d057e4faaecc36d19e0d3695f57
Author: Roger Sayle <roger@nextmovesoftware.com>
Date:   Tue Jun 7 07:54:13 2022 +0100

    PR c++/96442: Improved error recovery in enumerations.

    This patch is a revised fix for PR c++/96442 providing a cleaner
    solution, setting ENUM_UNDERLYING_TYPE to integer_type_node when
    issuing an error, so that this invariant holds during the parser's
    error recovery.

    2022-06-07  Roger Sayle  <roger@nextmovesoftware.com>

            PR c++/96442
            * decl.cc (start_enum): When emitting a "must be integral" error,
            set ENUM_UNDERLYING_TYPE to integer_type_node, to avoid an ICE
            downstream in build_enumeration.

            PR c++/96442
            * g++.dg/parse/pr96442.C: New test case.

More information about the Gcc-bugs mailing list