This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH] PR fortran/77506
- From: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- To: kargl at uw dot edu
- Cc: Fortran List <fortran at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 9 Sep 2016 09:31:35 +0300
- Subject: Re: [PATCH] PR fortran/77506
- Authentication-results: sourceware.org; auth=none
- References: <20160909001339.GA60922@troutmask.apl.washington.edu>
On Fri, Sep 9, 2016 at 3:13 AM, Steve Kargl
<sgk@troutmask.apl.washington.edu> wrote:
> Regression tested on x86_64-*-freebsd. OK to commit?
>
> 2016-09-08 Steven G. Kargl <kargl@gcc.gnu.org>
>
> PR fortran/77506
> * array.c (gfc_match_array_constructor): CHARACTER(len=*) cannot
> appear in an array constructor.
>
> 2016-09-08 Steven G. Kargl <kargl@gcc.gnu.org>
>
> PR fortran/77506
> * gfortran.dg/pr77506.f90: New test.
>
> Index: gcc/fortran/array.c
> ===================================================================
> --- gcc/fortran/array.c (revision 240039)
> +++ gcc/fortran/array.c (working copy)
> @@ -1142,6 +1142,15 @@ gfc_match_array_constructor (gfc_expr **
> 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)
> Index: gcc/testsuite/gfortran.dg/pr77506.f90
> ===================================================================
> --- gcc/testsuite/gfortran.dg/pr77506.f90 (nonexistent)
> +++ gcc/testsuite/gfortran.dg/pr77506.f90 (working copy)
> @@ -0,0 +1,4 @@
> +! { dg-do compile }
> +program foo
> + print *, [character(len=*)::'ab','cd'] ! { dg-error "contain an asterisk" }
> +end program foo
>
> --
> Steve
Ok, thanks.
--
Janne Blomqvist