https://gcc.gnu.org/g:141636b5a8b889945eebdaa0198308cd840902cb

commit 141636b5a8b889945eebdaa0198308cd840902cb
Author: Mikael Morin <[email protected]>
Date:   Fri Oct 16 21:37:53 2026 +0200

    Correction type descripteur

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

diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc
index abc606dc627f..153196e6c683 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -8587,7 +8587,13 @@ gfc_conv_expr_descriptor (gfc_se *se, gfc_expr *expr)
             subobject for a subreference of the array.  */
          if (expr->ts.type == BT_CHARACTER
              || (subref_array_target && !se->direct_byref))
-           parmtype = gfc_typenode_for_spec (&expr->ts);
+           {
+             gfc_typespec *ts = &expr->ts;
+             if (ts->type == BT_CLASS
+                 && ts->u.derived->attr.is_class)
+               ts = &ts->u.derived->components->ts;
+             parmtype = gfc_typenode_for_spec (ts);
+           }
          else
            parmtype = gfc_get_element_type (TREE_TYPE (desc));

Reply via email to