===================================================================
*************** trans_associate_var (gfc_symbol *sym, gf
{
if (e->symtree
&& DECL_LANG_SPECIFIC (e->symtree->n.sym->backend_decl)
! && GFC_DECL_SAVED_DESCRIPTOR (e->symtree->n.sym->backend_decl))
/* Use the original class descriptor stored in the saved
descriptor to get the target_expr. */
target_expr =
{
if (e->symtree
&& DECL_LANG_SPECIFIC (e->symtree->n.sym->backend_decl)
! && GFC_DECL_SAVED_DESCRIPTOR (e->symtree->n.sym->backend_decl)
! && TREE_CODE (target_expr) != COMPONENT_REF)
/* Use the original class descriptor stored in the saved
descriptor to get the target_expr. */
target_expr =
===================================================================
***************
+ ! { dg=do run }
+ !
+ ! Test the fix for PR90498.
+ !
+ ! Contributed by Vladimir Fuka <vladimir.fuka@gmail.com>
+ !
+ type field_names_a
+ class(*), pointer :: var(:) =>null()
+ end type
+
+ type(field_names_a),pointer :: a(:)
+ allocate (a(2))
+
+ allocate (a(1)%var(2), source = ["hello"," vlad"])
+ allocate (a(2)%var(2), source = ["HELLO"," VLAD"])
+ call s(a)
+ deallocate (a(1)%var)
+ deallocate (a(2)%var)
+ deallocate (a)
+ contains
+ subroutine s(a)
+
+ type(field_names_a) :: a(:)
+
+ select type (var => a(1)%var)
+ type is (character(*))
+ if (any (var .ne. ["hello"," vlad"])) stop 1
+ class default
+ stop
+ end select
+
+ associate (var => a(2)%var)
+ select type (var)
+ type is (character(*))
+ if (any (var .ne. ["HELLO"," VLAD"])) stop 2
+ class default
+ stop
+ end select
+ end associate
+ end
+ end