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
+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
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;
+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
--- /dev/null
+! { 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