primary.c (gfc_match_structure_constructor): Allow constructor for types without components.
2007-11-22 Tobias Burnus <burnus@net-b.de> * primary.c (gfc_match_structure_constructor): Allow constructor for types without components. 2007-11-22 Tobias Burnus <burnus@net-b.de> * gfortran.dg/derived_constructor_comps_3.f90: New. From-SVN: r130358
This commit is contained in:
parent
cd9a21ca0b
commit
d4d757e6b5
4 changed files with 32 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2007-11-22 Tobias Burnus <burnus@net-b.de>
|
||||
|
||||
* primary.c (gfc_match_structure_constructor): Allow
|
||||
constructor for types without components.
|
||||
|
||||
2007-11-22 Tobias Burnus <burnus@net-b.de>
|
||||
|
||||
PR fortran/34079
|
||||
|
|
|
@ -1979,7 +1979,7 @@ gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result)
|
|||
if (gfc_match_char (')') != MATCH_YES)
|
||||
goto syntax;
|
||||
|
||||
if (comp->next != NULL)
|
||||
if (comp && comp->next != NULL)
|
||||
{
|
||||
gfc_error ("Too few components in structure constructor at %C");
|
||||
goto cleanup;
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2007-11-22 Tobias Burnus <burnus@net-b.de>
|
||||
|
||||
* gfortran.dg/derived_constructor_comps_3.f90: New.
|
||||
|
||||
2007-11-22 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/34094
|
||||
|
|
22
gcc/testsuite/gfortran.dg/derived_constructor_comps_3.f90
Normal file
22
gcc/testsuite/gfortran.dg/derived_constructor_comps_3.f90
Normal file
|
@ -0,0 +1,22 @@
|
|||
! { dg-compile }
|
||||
!
|
||||
! gfortran was ICEing for the constructor of
|
||||
! componentfree types.
|
||||
!
|
||||
! Contributed by James Van Buskirk
|
||||
! http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/c8dd08d6da052499/
|
||||
!
|
||||
module bug4_mod
|
||||
implicit none
|
||||
type bug4 ! no components
|
||||
end type bug4
|
||||
end module bug4_mod
|
||||
|
||||
program bug4_structure
|
||||
use bug4_mod
|
||||
implicit none
|
||||
type(bug4) t
|
||||
t = bug4()
|
||||
write(*,*) t
|
||||
end program bug4_structure
|
||||
! { dg-final { cleanup-modules "bug4_mod" } }
|
Loading…
Add table
Reference in a new issue