This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR fortran/82934,83318 -- Enforce F2008:C631
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 10 Dec 2017 09:48:17 -0800
- Subject: Re: [PATCH] PR fortran/82934,83318 -- Enforce F2008:C631
- Authentication-results: sourceware.org; auth=none
- References: <20171209011328.GA42376@troutmask.apl.washington.edu> <20171209195501.GA92608@troutmask.apl.washington.edu> <CAGkQGiKKmc7Kop_ZscrSQT-DTLoSUt8_Tgoyh6y013=Hg-_xwQ@mail.gmail.com>
- Reply-to: sgk at troutmask dot apl dot washington dot edu
On Sun, Dec 10, 2017 at 05:18:53PM +0000, Paul Richard Thomas wrote:
> Hi Steve,
>
> I see that the implementation of the standard is slightly more
> complicated than I thought.
I haven't played with PDT, yet. My patch only deals with
assumed length character. See below for a question.
> type :: t(a,b)
> integer, kind :: a
> integer, len :: b
> integer(a) :: v(b)
> end type t
>
> type(t(4,:)), allocatable :: z1
> type(t(4,10)), allocatable :: z2
>
> allocate (t(4, :) :: z1) ! { dg-error "cannot contain DEFERRED parameters" }
> allocate (t(4, *) :: z2) ! This should give an error because it isn't a dummy.
>
> call foo (z1, z2, z2)
>
> contains
> subroutine foo (arg1, arg2, arg3)
> type(t(4,:)), allocatable :: arg1
> type(t(4,*)), allocatable :: arg2
> type(t(4,10)), allocatable :: arg3
>
> allocate (t(4, :) :: arg1) ! { dg-error "cannot contain DEFERRED
> parameters" }
> allocate (t(4, *) :: arg2) ! This needs to be handled correctly at
> runtime but is legal.
> allocate (t(4, *) :: arg2) ! This should give an error because the
Did you mean arg3 here?
> dummy parameter is not assumed.
> end subroutine
>
> end
>
> I'll hit this next weekend because I am away all this week.
>
--
steve