re PR fortran/33957 (gfortran rejects valid initialization expression)

PR fortran/33957

	* gfortran.dg/initialization_15.f90 : New test.

	* expr.c (check_inquiry): Don't call gfc_error now.

From-SVN: r130246
This commit is contained in:
Francois-Xavier Coudert 2007-11-16 22:38:21 +00:00 committed by François-Xavier Coudert
parent fb0a0e1591
commit f5fd0cf12d
4 changed files with 18 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2007-11-16 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33957
* expr.c (check_inquiry): Don't call gfc_error now.
2007-11-16 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33739

View file

@ -1981,11 +1981,7 @@ check_inquiry (gfc_expr *e, int not_restricted)
break;
if (functions[i] == NULL)
{
gfc_error ("Inquiry function '%s' at %L is not permitted "
"in an initialization expression", name, &e->where);
return MATCH_ERROR;
}
return MATCH_ERROR;
/* At this point we have an inquiry function with a variable argument. The
type of the variable might be undefined, but we need it now, because the

View file

@ -1,3 +1,8 @@
2007-11-16 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33957
* gfortran.dg/initialization_15.f90 : New test.
2007-11-16 Richard Guenther <rguenther@suse.de>
PR middle-end/34030

View file

@ -0,0 +1,7 @@
! { dg-do compile }
! Test by Dominique d'Humieres (PR 33957)
function bug(i) result(c)
integer, pointer :: i
character(len=merge(1,2, associated(i))) :: c
c = ""
end function bug