Index: flang/lib/Semantics/check-declarations.cpp =================================================================== --- flang/lib/Semantics/check-declarations.cpp +++ flang/lib/Semantics/check-declarations.cpp @@ -353,6 +353,9 @@ messages_.Say( "An assumed-length CHARACTER(*) function cannot return a POINTER"_err_en_US); } + } else if (IsDummy(symbol) && IsPointer(symbol)) { + messages_.Say( + "A procedure pointer can not have assumed-length CHARACTER(*) result type"_err_en_US); } } if (symbol.attrs().test(Attr::VALUE)) { Index: flang/test/Semantics/call01.f90 =================================================================== --- flang/test/Semantics/call01.f90 +++ flang/test/Semantics/call01.f90 @@ -119,9 +119,11 @@ end function subroutine s01(f1, f2, fp1, fp2) + !ERROR: A procedure pointer can not have assumed-length CHARACTER(*) result type character*(*) :: f1, f3, fp1 external :: f1, f3 pointer :: fp1 + !ERROR: A procedure pointer can not have assumed-length CHARACTER(*) result type procedure(character*(*)), pointer :: fp2 interface character*(*) function f2()