PDT: KIND and LEN type parameters are mutually exclusive

The following invalid code is erroneously accepted by nvfortran 21.9 and earlier:

  type :: bad_pdt (k,l)
     integer, kind, len      :: k = 1
     integer, len, kind      :: l = 1
     character(kind=k,len=l) :: c
  end type bad_pdt

The Fortran 2018 standard (and similarly earlier versions down to 2003) state:

F2018:  Type parameter definition statement

R732  type-param-def-stmt is
      integer-type-spec, type-param-attr-spec :: type-param-decl-list

R734  type-param-attr-spec  is KIND or LEN

(3) The type-param-attr-spec explicitly specifies whether a type parameter is a kind parameter or a length parameter.

Thus the KIND and LEN attributes are mutually exclusive.
The correct solution would be to reject the code sample.


Thanks Harald. I filed a problem report, TPR #30827, and sent it to engineering for further review.