array.c (gfc_match_array_constructor): Disallow empty array constructor.

fortran/
2005-06-03  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
	Erik Edelmann  <erik.edelmann@iki.fi>

	* array.c (gfc_match_array_constructor): Disallow empty array
	constructor.
testsuite/
2005-06-04  Erik Edelmann  <erik.edelmann@iki.fi>

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

From-SVN: r100579
This commit is contained in:
Tobias Schlüter 2005-06-04 12:26:57 +02:00
parent 9a28687dcf
commit ab21e2722d
4 changed files with 19 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2005-06-03 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
Erik Edelmann <erik.edelmann@iki.fi>
* array.c (gfc_match_array_constructor): Disallow empty array
constructor.
2005-06-03 Jerry DeLisle <jvdelisle@verizon.net>
* fortran/intrinsic.texi: Add documentation for

View File

@ -887,7 +887,10 @@ gfc_match_array_constructor (gfc_expr ** result)
head = tail = NULL;
if (gfc_match (end_delim) == MATCH_YES)
goto empty; /* Special case */
{
gfc_error ("Empty array constructor at %C is not allowed");
goto cleanup;
}
for (;;)
{
@ -911,7 +914,6 @@ gfc_match_array_constructor (gfc_expr ** result)
if (gfc_match (end_delim) == MATCH_NO)
goto syntax;
empty:
expr = gfc_get_expr ();
expr->expr_type = EXPR_ARRAY;

View File

@ -1,3 +1,7 @@
2005-06-04 Erik Edelmann <erik.edelmann@iki.fi>
* gfortran.dg/array_constructor_3.f90: New test.
2005-06-04 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
* gfortran.dg/ret_pointer_1.f90: Un-XFAIL.

View File

@ -0,0 +1,5 @@
! { dg-do compile }
! Check that empty array constructors are rejected
program hum
print *, (//) { dg-error "Empty array constructor" }
end program hum