Hi Steve,
This is good for trunk with one proviso:
This should mutate from:
- /* TODO understand why this error does not appear but, instead,
- the derived type is caught as a variable in primary.c. */
- if (gfc_spec_list_type (type_param_spec_list, NULL) != SPEC_EXPLICIT)
{
- gfc_error ("The type parameter spec list in the type-spec at "
- "%L cannot contain ASSUMED or DEFERRED parameters",
- &old_locus);
- goto cleanup;
to (ignoring lhs white space and tabs):
if (type_param_spec_list
&& gfc_spec_list_type (type_param_spec_list, NULL) == SPEC_DEFERRED)
{
gfc_error ("The type parameter spec list in the type-spec at "
%L cannot contain DEFERRED parameters", &old_locus);
goto cleanup;
}
which retains the appropriate error for PDTs.
Cheers
Paul
On 9 December 2017 at 01:13, Steve Kargl
<[email protected]> wrote:
> The attached patch enforces F2008:C631, which of course is
>
> /* F2008:C631 (R626) A type-param-value in a type-spec shall be an
> asterisk if and only if each allocate-object is a dummy argument
> for which the corresponding type parameter is assumed. */
>
> Regression tested on x86_64-*-freebsd.
>
> 2017-12-08 Steven G. Kargl <[email protected]>
>
> PR fortran/82934
> PR fortran/83318
> * match.c (gfc_match_allocate): Enforce F2008:C631.
>
> 2017-12-08 Steven G. Kargl <[email protected]>
>
> PR fortran/82934
> PR fortran/83318
> * gfortran.dg/allocate_assumed_charlen_2.f90: new test.
>
> --
> Steve
--
"If you can't explain it simply, you don't understand it well enough"
- Albert Einstein