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

--- 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:b3d078220d202094a2b4eaef9b4a5ad1b84d30e6

commit r15-7825-gb3d078220d202094a2b4eaef9b4a5ad1b84d30e6
Author: Simon Martin <si...@nasilyan.com>
Date:   Wed Mar 5 09:08:57 2025 +0100

    c++: Fix checking assert upon invalid class definition [PR116740]

    A checking assert triggers upon the following invalid code since
    GCC 11:

    === cut here ===
    class { a (struct b;
    } struct b
    === cut here ===

    The problem is that during error recovery, we call
    set_identifier_type_value_with_scope for B in the global namespace, and
    the checking assert added via r11-7228-g8f93e1b892850b fails.

    This patch relaxes that assert to not fail if we've seen a parser error
    (it a generalization of another fix done to that checking assert via
    r11-7266-g24bf79f1798ad1).

            PR c++/116740

    gcc/cp/ChangeLog:

            * name-lookup.cc (set_identifier_type_value_with_scope): Don't
            fail assert with ill-formed input.

    gcc/testsuite/ChangeLog:

            * g++.dg/parse/crash80.C: New test.
  • [Bug c++/116740] [12/13/14/15 R... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to