https://gcc.gnu.org/g:39fbf4e71a6356ca96e704613d037a902b1da2f0

commit 39fbf4e71a6356ca96e704613d037a902b1da2f0
Author: Mikael Morin <mik...@gcc.gnu.org>
Date:   Wed May 28 22:54:16 2025 +0200

    Correction régression transfer_class_3

Diff:
---
 gcc/fortran/trans-types.cc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gcc/fortran/trans-types.cc b/gcc/fortran/trans-types.cc
index 52ed1ade9623..a2cafaf1a8ef 100644
--- a/gcc/fortran/trans-types.cc
+++ b/gcc/fortran/trans-types.cc
@@ -3286,6 +3286,11 @@ gfc_get_derived_type (gfc_symbol * derived, int codimen)
                  && c->ts.u.derived->attr.unlimited_polymorphic
                  && field_type == ptr_type_node)
                field_type = char_type_node;
+
+             bt type_type = derived->attr.is_class
+                            && strcmp (c->name, "_data") == 0
+                            ? BT_CLASS : c->ts.type;
+
              /* Pointers to arrays aren't actually pointer types.  The
                 descriptors are separate, but the data is common.  Every
                 array pointer in a coarray derived type needs to provide space
@@ -3296,7 +3301,7 @@ gfc_get_derived_type (gfc_symbol * derived, int codimen)
                  field_type, c->as, akind, !c->attr.target && !c->attr.pointer,
                  c->attr.contiguous,
                  c->attr.codimension || c->attr.pointer ? codimen : 0,
-                 c->ts.type
+                 type_type
                );
            }
          else

Reply via email to