From e81e83d04796b834c9f3e63d74b7202bca28e5c9 Mon Sep 17 00:00:00 2001 From: "Steven G. Kargl" Date: Fri, 9 Sep 2016 18:04:23 +0000 Subject: re PR fortran/77506 (F2008 Standard does not allow CHARACTER(LEN=*) in array constructor) 2016-09-09 Steven G. Kargl PR fortran/77506 * array.c (gfc_match_array_constructor): CHARACTER(len=*) cannot appear in an array constructor. 2016-09-09 Steven G. Kargl PR fortran/77506 * gfortran.dg/pr77506.f90: New test. From-SVN: r240052 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/array.c | 9 +++++++++ 2 files changed, 15 insertions(+) (limited to 'gcc/fortran') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index a0afe04..284bf7d 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,11 @@ 2016-09-09 Steven G. Kargl + PR fortran/77506 + * array.c (gfc_match_array_constructor): CHARACTER(len=*) cannot + appear in an array constructor. + +2016-09-09 Steven G. Kargl + PR fortran/77507 * intrinsic.c (add_functions): Use correct keyword. diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index 48a7250..14e20a3 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -1142,6 +1142,15 @@ gfc_match_array_constructor (gfc_expr **result) gfc_restore_last_undo_checkpoint (); goto cleanup; } + + if (ts.type == BT_CHARACTER + && ts.u.cl && !ts.u.cl->length && !ts.u.cl->length_from_typespec) + { + gfc_error ("Type-spec at %L cannot contain an asterisk for a " + "type parameter", &where); + gfc_restore_last_undo_checkpoint (); + goto cleanup; + } } } else if (m == MATCH_ERROR) -- cgit v1.1