From: dfranke Date: Thu, 10 Dec 2009 21:03:40 +0000 (+0000) Subject: 2009-12-10 Daniel Franke X-Git-Tag: upstream/4.9.2~31963 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6d6202444e629924e529f8ae07aafe002b4abd94;p=platform%2Fupstream%2Flinaro-gcc.git 2009-12-10 Daniel Franke PR fortran/41369 * parse.c (match_deferred_characteristics): Removed check for empty types in function return values. 2009-12-10 Daniel Franke PR fortran/41369 * gfortran.dg/func_derived_5.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155141 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 7280dd7..b1bec37 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,11 @@ 2009-12-10 Daniel Franke + PR fortran/41369 + * parse.c (match_deferred_characteristics): Removed check for empty + types in function return values. + +2009-12-10 Daniel Franke + PR fortran/34402 * expr.c (check_alloc_comp_init): New. (check_init_expr): Verify that allocatable components diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index c5d3548..98d684f 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -2340,7 +2340,7 @@ match_deferred_characteristics (gfc_typespec * ts) { ts->kind = 0; - if (!ts->u.derived || !ts->u.derived->components) + if (!ts->u.derived) m = MATCH_ERROR; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fd0628f..2b1220b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-12-10 Daniel Franke + + PR fortran/41369 + * gfortran.dg/func_derived_5.f90: New. + 2009-12-10 Jan Hubicka PR middle-end/42110 diff --git a/gcc/testsuite/gfortran.dg/func_derived_5.f90 b/gcc/testsuite/gfortran.dg/func_derived_5.f90 new file mode 100644 index 0000000..afe5ec0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/func_derived_5.f90 @@ -0,0 +1,14 @@ +! { dg-do "compile" } +! PR fortran/41369 - rejected empty type in function return values + +module m + type t + end type t +end module + +type(t) function foo() + use m + foo = t() +end function foo + +! { dg-final { cleanup-modules "m" } }