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

Drea Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2026-09-30
     Ever confirmed|0                           |1
            Summary|Segfault in                 |[14/15/16/17 Regression]
                   |decl_namespace_context:     |Segfault in
                   |function type has no        |decl_namespace_context:
                   |TYPE_MAIN_DECL              |function type has no
                   |                            |TYPE_MAIN_DECL
      Known to work|                            |12.1.0
      Known to fail|                            |13.1.0

--- Comment #1 from Drea Pinski <pinskia at gcc dot gnu.org> ---
            if (!in_main_input_context()) // is the reason why does not ICE
without the include.
              {
                tree nlt = no_linkage_check (ftype, /*relaxed_p=*/false);
                if (nlt)
                  {
                    if (same_type_p (TREE_TYPE (t), nlt))
                      warning (OPT_Wsubobject_linkage, "\
%qT has a field %q#D whose type has no linkage",
                               type, t);
                    else
                      warning (OPT_Wsubobject_linkage, "\
%qT has a field %qD whose type depends on the type %qT which has no linkage",
                               type, t, nlt);
                  }
                else if (cxx_dialect > cxx98
                         && !decl_anon_ns_mem_p (ftype)) // this check here
                  warning (OPT_Wsubobject_linkage, "\
%qT has a field %q#D whose type has internal linkage",
                           type, t);
                else // In C++98 this can only happen with unnamed namespaces.
                  warning (OPT_Wsubobject_linkage, "\
%qT has a field %q#D whose type uses the anonymous namespace",
                           type, t);
              }

>This is reproducible from GCC 13 onward.
Which points to r13-2627-g8ef5fa4c56c82d .

Reply via email to