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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:205591919214cb5610e9c3b2394f05a3cfaa7f68

commit r15-5919-g205591919214cb5610e9c3b2394f05a3cfaa7f68
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Wed Dec 4 10:54:41 2024 +0100

    c++: Fix up erroneous template error recovery ICE [PR117826]

    The testcase in the PR (which can't be easily reduced and is
    way too large and has way too many errors) results in an ICE,
    because the erroneous_templates hash_map holds trees of erroneous
    templates across ggc_collect and some of the templates in there
    could be removed, so the later lookup can crash on comparison of
    already freed and reused trees.

    The following patch makes the hash_map GTY((cache)) marked.
    The cp-tree.h changes before the erroneous_template declaration
    are needed to make gengtype happy, it didn't like using
    directive nor using a template-id as a template parameter.

    It is marked cache because if a decl would be solely referenced from
    the erroneous_templates hash_map, then nothing would look it up.

    2024-12-04  Jakub Jelinek  <ja...@redhat.com>

            PR c++/117826
            * cp-tree.h (struct decl_location_traits): New type.
            (erroneous_templates_t): Change using into typedef.
            (erroneous_templates): Add GTY((cache)).
            * error.cc (cp_adjust_diagnostic_info): Use
            hash_map_safe_get_or_insert<true> rather than
            hash_map_safe_get_or_insert<false> for erroneous_templates.

Reply via email to