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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
We have a CONST_DECL with null type -- it's the case when the underlying type
is not fixed, and finish_enum_value_list hasn't yet run.  A stopgap fix would
be

--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -2762,7 +2762,9 @@ check_local_shadow (tree decl)
       enum opt_code warning_code;
       if (warn_shadow)
    warning_code = OPT_Wshadow;
-      else if (same_type_p (TREE_TYPE (old), TREE_TYPE (decl))
+      else if ((TREE_TYPE (old)
+       && TREE_TYPE (decl)
+       && same_type_p (TREE_TYPE (old), TREE_TYPE (decl)))
           || TREE_CODE (decl) == TYPE_DECL
           || TREE_CODE (old) == TYPE_DECL
           || (!dependent_type_p (TREE_TYPE (decl))

Reply via email to