https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121185
--- Comment #42 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Mikael Morin <mik...@gcc.gnu.org>: https://gcc.gnu.org/g:5f9f20df98b1fe8dd8b179b157d268470bde70f4 commit r16-2566-g5f9f20df98b1fe8dd8b179b157d268470bde70f4 Author: Mikael Morin <mik...@gcc.gnu.org> Date: Sun Jul 27 17:11:40 2025 +0200 fortran: Bound class container lookup after array descriptor [PR121185] Don't look for a class container too far after an array descriptor. This avoids generating a polymorphic array reference, using the virtual table of a parent object, to access a non-polymorphic child having a type unrelated to that of the parent. PR fortran/121185 gcc/fortran/ChangeLog: * trans-expr.cc (gfc_get_class_from_expr): Give up class container lookup on the second COMPONENT_REF after an array descriptor. gcc/testsuite/ChangeLog: * gfortran.dg/assign_13.f90: New test.