vec_safe_push (typelist, boolean_type_node);
/* Coarrays which are descriptorless or assumed-shape pass with
-fcoarray=lib the token and the offset as hidden arguments. */
- else if (arg
- && flag_coarray == GFC_FCOARRAY_LIB
- && ((arg->ts.type != BT_CLASS
- && arg->attr.codimension
- && !arg->attr.allocatable)
- || (arg->ts.type == BT_CLASS
- && CLASS_DATA (arg)->attr.codimension
- && !CLASS_DATA (arg)->attr.allocatable)))
+ if (arg
+ && flag_coarray == GFC_FCOARRAY_LIB
+ && ((arg->ts.type != BT_CLASS
+ && arg->attr.codimension
+ && !arg->attr.allocatable)
+ || (arg->ts.type == BT_CLASS
+ && CLASS_DATA (arg)->attr.codimension
+ && !CLASS_DATA (arg)->attr.allocatable)))
{
vec_safe_push (typelist, pvoid_type_node); /* caf_token. */
vec_safe_push (typelist, gfc_array_index_type); /* caf_offset. */
--- /dev/null
+! { dg-do compile }
+!
+! PR fortran/99817
+!
+! Contributed by G. Steinmetz
+!
+subroutine s1 (x)
+ character(*) :: x(*)[*]
+end
+
+subroutine s2 (x)
+ character(*), dimension(*), codimension[*] :: x
+ integer :: i
+ i = len(x)
+end
+
+subroutine s3 (x, y)
+ character(*), dimension(:) :: x[*]
+ character(*) :: y
+end
+
+subroutine s4 (x, y, z)
+ character(*), dimension(:) :: x[2, *]
+ character(*), dimension(*) :: y
+ character(*) :: z
+end