re PR fortran/24426 (gfortran ICE for valid derived type definition with default initialization)

2005-10-22  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/24426
        * decl.c (variable_decl): Don't assign default initializers to
                    pointers.


2005-10-22  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/24426
        * gfortran.dg/der_pointer_4.f90: New.

From-SVN: r105792
This commit is contained in:
Erik Edelmann 2005-10-22 17:02:42 +00:00
parent e7c84bf8e9
commit 6019a1a447
4 changed files with 23 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2005-10-22 Erik Edelmann <eedelman@gcc.gnu.org>
PR fortran/24426
* decl.c (variable_decl): Don't assign default initializers to
pointers.
2005-10-21 Jakub Jelinek <jakub@redhat.com>
* interface.c (compare_actual_formal): Issue error when attempting

View File

@ -1094,7 +1094,7 @@ variable_decl (int elem)
t = add_init_expr_to_sym (name, &initializer, &var_locus);
else
{
if (current_ts.type == BT_DERIVED && !initializer)
if (current_ts.type == BT_DERIVED && !current_attr.pointer && !initializer)
initializer = gfc_default_initializer (&current_ts);
t = build_struct (name, cl, &initializer, &as);
}

View File

@ -1,3 +1,8 @@
2005-10-22 Erik Edelmann <eedelman@gcc.gnu.org>
PR fortran/24426
* gfortran.dg/der_pointer_4.f90: New.
2005-10-22 David Ayers <d.ayers@inode.at>
* obj-c++.dg/except-1.mm: Simplify.

View File

@ -0,0 +1,11 @@
! {dg-do compile }
! PR 24426
! Pointer-components of derived type with initialized components
module crash
implicit none
type foo
integer :: i = 0
type (foo), pointer :: next
end type foo
type (foo) :: bar
end module crash