gcc/fortran/ChangeLog:
PR fortran/102956
* symbol.c (gfc_check_conflict): Add conflict check for PDT KIND
and LEN type parameters.
gcc/testsuite/ChangeLog:
PR fortran/102956
* gfortran.dg/pdt_32.f03: New test.
conf (pdt_len, pointer)
conf (pdt_len, dimension)
conf (pdt_len, codimension)
+ conf (pdt_len, pdt_kind)
if (attr->access == ACCESS_PRIVATE)
{
--- /dev/null
+! { dg-do compile }
+! PR fortran/102956
+! PDT KIND and LEN type parameters are mutually exclusive (F2018:R734)
+!
+module m
+ type :: good_pdt (k,l)
+ integer, kind :: k = 1
+ integer, len :: l = 1
+ character(kind=k,len=l) :: c
+ end type good_pdt
+
+ type :: bad_pdt (k,l) ! { dg-error "does not have a component" }
+ integer, kind, len :: k = 1 ! { dg-error "attribute conflicts with" }
+ integer, len, kind :: l = 1 ! { dg-error "attribute conflicts with" }
+ character(kind=k,len=l) :: c ! { dg-error "has not been declared" }
+ end type bad_pdt
+end