This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/57033] [4.7/4.8/4.9 Regression] ICE on extended derived type and default initialization
- From: "mikael at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 26 Jan 2014 16:28:35 +0000
- Subject: [Bug fortran/57033] [4.7/4.8/4.9 Regression] ICE on extended derived type and default initialization
- Auto-submitted: auto-generated
- References: <bug-57033-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57033
Mikael Morin <mikael at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mikael at gcc dot gnu.org
--- Comment #4 from Mikael Morin <mikael at gcc dot gnu.org> ---
Simple fix:
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -2544,7 +2544,8 @@ gfc_convert_to_structure_constructor (gfc_expr *e,
gfc_symbol *sym, gfc_expr **c
if (parent && !comp)
break;
- actual = actual->next;
+ if (actual)
+ actual = actual->next;
}
if (!build_actual_constructor (&comp_head, &ctor_head, sym))
I was about to commit it, then I thought there was something wrong;
Is the following code valid? It is currently rejected with:
comment_0_modif.f90:14.6:
meo = me(1, 2) ! ICE
1
Error: No initializer for component 'j' given in the structure constructor at
(1)!
!!!!!!!!!!!!!!!!
program ice
type m
integer i
logical :: f = .false.
end type m
type, extends(m) :: me
integer :: j
end type me
type(me) meo
meo = me(1, 2) ! ICE
end program ice
!!!!!!!!!!!!!!!!