fortran/
PR fortran/20323
* resolve.c (gfc_resolve): Check if character lengths are
specification expressions.
testsuite/
PR fortran/20323
* gfortran.dg/spec_expr_1.f90: New test.
From-SVN: r96382
+2005-03-13 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
+
+ PR fortran/20323
+ * resolve.c (gfc_resolve): Check if character lengths are
+ specification expressions.
+
2005-03-12 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/20361
if (cl->length == NULL || gfc_resolve_expr (cl->length) == FAILURE)
continue;
- if (cl->length->ts.type != BT_INTEGER)
- gfc_error
- ("Character length specification at %L must be of type INTEGER",
- &cl->length->where);
+ if (gfc_simplify_expr (cl->length, 0) == FAILURE)
+ continue;
+
+ if (gfc_specification_expr (cl->length) == FAILURE)
+ continue;
}
gfc_traverse_ns (ns, resolve_values);
+2005-03-13 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
+
+ PR fortran/20323
+ * gfortran.dg/spec_expr_1.f90: New test.
+
2005-03-13 Joseph S. Myers <joseph@codesourcery.com>
PR c/20402
--- /dev/null
+! { dg-do compile }
+! PR 20323
+! We didn't verify that character length expressions are specification
+! expressions.
+function testpresent(arg)
+ integer, intent(in), optional :: arg
+ character(len=arg) :: s ! { dg-error "OPTIONAL" }
+ logical :: testpresent
+
+ testpresent=.true.
+
+end function testpresent