https://gcc.gnu.org/g:84f672e16fee51f7630256ea8775e457caa4c723

commit 84f672e16fee51f7630256ea8775e457caa4c723
Author: Mikael Morin <mik...@gcc.gnu.org>
Date:   Thu Jul 17 12:22:25 2025 +0200

    Prise en charge type polymorphe

Diff:
---
 gcc/fortran/trans-descriptor.cc | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/gcc/fortran/trans-descriptor.cc b/gcc/fortran/trans-descriptor.cc
index 3edc7a34809e..f867beb16511 100644
--- a/gcc/fortran/trans-descriptor.cc
+++ b/gcc/fortran/trans-descriptor.cc
@@ -685,10 +685,15 @@ gfc_clear_descriptor (stmtblock_t *block, gfc_symbol 
*sym, tree descr)
 
   tree etype;
 
-  gcc_assert (sym->as && sym->as->rank>=0);
+  gfc_array_spec *as;
+  if (sym->ts.type == BT_CLASS)
+    as = CLASS_DATA (sym)->as;
+  else
+    as = sym->as;
+
+  gcc_assert (as && as->rank >= 0);
   etype = gfc_get_element_type (TREE_TYPE (descr));
   gfc_conv_descriptor_dtype_set (block, descr,
-                                gfc_get_dtype_rank_type (sym->as->rank,
-                                                         etype));
+                                gfc_get_dtype_rank_type (as->rank, etype));
 }

Reply via email to