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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Marek Polacek <mpola...@gcc.gnu.org>:

https://gcc.gnu.org/g:c2e64c33d9d903f0a52565ad98300feea0ffc580

commit r11-7535-gc2e64c33d9d903f0a52565ad98300feea0ffc580
Author: Marek Polacek <pola...@redhat.com>
Date:   Fri Mar 5 10:41:41 2021 -0500

    c++: ICE with -Wshadow and enumerator in template [PR99120]

    We crash here, because in a template, an enumerator doesn't have
    a type until we've called finish_enum_value_list.  But our -Wshadow
    implementation, check_local_shadow, is called when we pushdecl in
    build_enumerator, which takes place before finish_enum_value_list.

    gcc/cp/ChangeLog:

            PR c++/99120
            * name-lookup.c (check_local_shadow): Check if the type of decl
            is non-null before checking TYPE_PTR*.

    gcc/testsuite/ChangeLog:

            PR c++/99120
            * g++.dg/warn/Wshadow-17.C: New test.

Reply via email to