re PR fortran/40402 (Problem with data statement involving structure constructors containing non-initialisation expressions)
2009-06-11 Paul Thomas <pault@gcc.gnu.org> PR fortran/40402 * resolve.c (next_data_value): It is an error if the value is not constant. 2009-06-11 Paul Thomas <pault@gcc.gnu.org> PR fortran/40402 * gfortran.dg/data_value_1.f90: New test. From-SVN: r148396
This commit is contained in:
parent
5514b0f3df
commit
abeab93869
|
@ -1,3 +1,9 @@
|
|||
2009-06-11 Paul Thomas <pault@gcc.gnu.org>
|
||||
|
||||
PR fortran/40402
|
||||
* resolve.c (next_data_value): It is an error if the value is
|
||||
not constant.
|
||||
|
||||
2009-06-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
|
||||
|
||||
PR fortran/38718
|
||||
|
|
|
@ -9852,9 +9852,12 @@ values;
|
|||
static gfc_try
|
||||
next_data_value (void)
|
||||
{
|
||||
|
||||
while (mpz_cmp_ui (values.left, 0) == 0)
|
||||
{
|
||||
if (!gfc_is_constant_expr (values.vnode->expr))
|
||||
gfc_error ("non-constant DATA value at %L",
|
||||
&values.vnode->expr->where);
|
||||
|
||||
if (values.vnode->next == NULL)
|
||||
return FAILURE;
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2009-06-11 Paul Thomas <pault@gcc.gnu.org>
|
||||
|
||||
PR fortran/40402
|
||||
* gfortran.dg/data_value_1.f90: New test.
|
||||
|
||||
2009-06-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
|
||||
|
||||
PR testsuite/39831
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
! { dg-do compile }
|
||||
! Test the fix for PR40402, in which it was not detected that X
|
||||
! is not a constant and so the DATA statement did not have
|
||||
! a constant value expression.
|
||||
!
|
||||
! Contributed by Philippe Marguinaud <philippe.marguinaud@meteo.fr>
|
||||
!
|
||||
TYPE POINT
|
||||
REAL :: X
|
||||
ENDTYPE
|
||||
TYPE(POINT) :: P
|
||||
DATA P / POINT(1.+X) / ! { dg-error "non-constant DATA value" }
|
||||
print *, p
|
||||
END
|
Loading…
Reference in New Issue