[PATCH] PR fortran/82934,83318 -- Enforce F2008:C631

Paul Richard Thomas paul.richard.thomas@gmail.com
Sun Dec 10 18:11:00 GMT 2017


Yes - thanks

Paul

On 10 December 2017 at 17:48, Steve Kargl
<sgk@troutmask.apl.washington.edu> wrote:
> 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



-- 
"If you can't explain it simply, you don't understand it well enough"
- Albert Einstein



More information about the Gcc-patches mailing list