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

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

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

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I think we just need to check OVERLOAD_TYPE_P before calling
decl_anon_ns_mem_p, sort of like min_vis_r checks

  else if (OVERLOAD_TYPE_P (*tp)
           && !TREE_PUBLIC (TYPE_MAIN_DECL (*tp)))

--- a/gcc/cp/decl2.cc
+++ b/gcc/cp/decl2.cc
@@ -3598,6 +3598,7 @@ constrain_class_visibility (tree type)
                   type, t, nlt);
          }
        else if (cxx_dialect > cxx98
+            && OVERLOAD_TYPE_P (ftype)
             && !decl_anon_ns_mem_p (ftype))
          warning (OPT_Wsubobject_linkage, "\
 %qT has a field %q#D whose type has internal linkage",


fixes the problem and doesn't regress anything.

Reply via email to