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

Martin Uecker <uecker at tugraz dot at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |uecker at tugraz dot at

--- Comment #16 from Martin Uecker <uecker at tugraz dot at> ---

As a first guess, maybe this fixes it... 

--- a/gcc/c/c-typeck.cc
+++ b/gcc/c/c-typeck.cc
@@ -1889,7 +1889,7 @@ tagged_types_tu_compatible_p (const_tree t1, const_tree
t2,
   /* When forming equivalence classes for TYPE_CANONICAL in C23, we treat
      structs with the same tag as equivalent, but only when they are targets
      of pointers inside other structs.  */
-  if (data->equiv && data->pointedto)
+  if (data->equiv && data->pointedto && NULL_TREE != c_type_tag (t1))
     return true;

   /* Different types without tag are incompatible except as an anonymous

Reply via email to