re PR fortran/15975 ([4.0 only] ICE in trans-array.c pointer array initialization stuff)
2005-09-18 Erik Edelmann <erik.edelmann@iki.fi> PR fortran/15975 * resolve.c (resolve_symbol): Don't assign default initializer to pointers. 2005-09-18 Erik Edelmann <erik.edelmann@iki.fi> PR fortran/15975 * gfortran.dg/der_pointer_2.f90: New test. From-SVN: r104389
This commit is contained in:
parent
6cda231ed9
commit
630b708642
4 changed files with 33 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
2005-09-18 Erik Edelmann <erik.edelmann@iki.fi>
|
||||
|
||||
PR fortran/15975
|
||||
* resolve.c (resolve_symbol): Don't assign default
|
||||
initializer to pointers.
|
||||
|
||||
2005-09-18 Paul Thomas <pault@gcc.gnu.org>
|
||||
|
||||
PR fortran/16861
|
||||
|
|
|
@ -4328,7 +4328,8 @@ resolve_symbol (gfc_symbol * sym)
|
|||
}
|
||||
|
||||
/* Assign default initializer. */
|
||||
if (sym->ts.type == BT_DERIVED && !(sym->value || whynot))
|
||||
if (sym->ts.type == BT_DERIVED && !(sym->value || whynot)
|
||||
&& !sym->attr.pointer)
|
||||
sym->value = gfc_default_initializer (&sym->ts);
|
||||
break;
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2005-09-18 Erik Edelmann <erik.edelmann@iki.fi>
|
||||
|
||||
PR fortran/15975
|
||||
* gfortran.dg/der_pointer_2.f90: New test.
|
||||
|
||||
2005-09-18 Paul Thomas <pault@gcc.gnu.org>
|
||||
|
||||
PR fortran/16861
|
||||
|
|
20
gcc/testsuite/gfortran.dg/der_pointer_2.f90
Normal file
20
gcc/testsuite/gfortran.dg/der_pointer_2.f90
Normal file
|
@ -0,0 +1,20 @@
|
|||
! { dg-do compile }
|
||||
! PR 15975, PR 16606
|
||||
! Pointers to derived types with initialized components
|
||||
!
|
||||
! Contributed by Erik Edelmann <erik.edelmann@iki.fi>
|
||||
!
|
||||
SUBROUTINE N
|
||||
TYPE T
|
||||
INTEGER :: I = 99
|
||||
END TYPE T
|
||||
TYPE(T), POINTER :: P
|
||||
TYPE(T), TARGET :: Q
|
||||
P => Q
|
||||
if (P%I.ne.99) call abort ()
|
||||
END SUBROUTINE N
|
||||
|
||||
program test_pr15975
|
||||
call n ()
|
||||
end program test_pr15975
|
||||
|
Loading…
Add table
Reference in a new issue