https://gcc.gnu.org/g:651a40d3a953ea9c6b8bbcbf99cc76d5f4e9739a
commit 651a40d3a953ea9c6b8bbcbf99cc76d5f4e9739a Author: Mikael Morin <[email protected]> Date: Mon Nov 23 11:47:18 2026 +0100 Retour void_type_node Diff: --- gcc/fortran/trans-types.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gcc/fortran/trans-types.cc b/gcc/fortran/trans-types.cc index ccf5f6d09e66..692391326da9 100644 --- a/gcc/fortran/trans-types.cc +++ b/gcc/fortran/trans-types.cc @@ -2910,12 +2910,14 @@ gfc_get_derived_type (gfc_symbol * derived, int codimen) gcc_assert (!derived->attr.pdt_template); - if (derived->attr.unlimited_polymorphic - || (flag_coarray == GFC_FCOARRAY_LIB - && derived->from_intmod == INTMOD_ISO_FORTRAN_ENV - && (derived->intmod_sym_id == ISOFORTRAN_LOCK_TYPE - || derived->intmod_sym_id == ISOFORTRAN_EVENT_TYPE - || derived->intmod_sym_id == ISOFORTRAN_TEAM_TYPE))) + if (derived->attr.unlimited_polymorphic) + return void_type_node; + + if (flag_coarray == GFC_FCOARRAY_LIB + && derived->from_intmod == INTMOD_ISO_FORTRAN_ENV + && (derived->intmod_sym_id == ISOFORTRAN_LOCK_TYPE + || derived->intmod_sym_id == ISOFORTRAN_EVENT_TYPE + || derived->intmod_sym_id == ISOFORTRAN_TEAM_TYPE)) return ptr_type_node; if (flag_coarray != GFC_FCOARRAY_LIB
