Commit d4d757e6 by Tobias Burnus Committed by Tobias Burnus

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
parent cd9a21ca
2007-11-22 Tobias Burnus <burnus@net-b.de> 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 PR fortran/34079
* trans-expr.c (gfc_conv_function_call): Do not append * trans-expr.c (gfc_conv_function_call): Do not append
string length arguments when calling bind(c) procedures. string length arguments when calling bind(c) procedures.
......
...@@ -1979,7 +1979,7 @@ gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result) ...@@ -1979,7 +1979,7 @@ gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result)
if (gfc_match_char (')') != MATCH_YES) if (gfc_match_char (')') != MATCH_YES)
goto syntax; goto syntax;
if (comp->next != NULL) if (comp && comp->next != NULL)
{ {
gfc_error ("Too few components in structure constructor at %C"); gfc_error ("Too few components in structure constructor at %C");
goto cleanup; goto cleanup;
......
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> 2007-11-22 Jakub Jelinek <jakub@redhat.com>
PR c++/34094 PR c++/34094
! { 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" } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment