https://gcc.gnu.org/g:7cf8e32310695ad11c5e771ce8c543f1f2ada691

commit 7cf8e32310695ad11c5e771ce8c543f1f2ada691
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 8b61b2649752..b3be0fdb6d30 100644
--- a/gcc/fortran/trans-types.cc
+++ b/gcc/fortran/trans-types.cc
@@ -3289,6 +3289,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
@@ -3299,7 +3304,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