Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29240 Discussions

Procedure pointer confused with PDT len parameter?

jwmwalrus
New Contributor I
489 Views

Hi.

The following code

module mod1
    implicit none

    type, public :: field
        logical :: max_width = .false.
        procedure(i_justify), pointer, nopass :: justify => null()
    end type

    abstract interface
        pure function i_justify(string, length) result(just)
            character(*), intent(in) :: string
            integer, intent(in) :: length
            character(length) :: just
        end function
    end interface
end module mod1

fails to compile with ifx:

$ ifx -V -c /media/vmshare/nopass-func-len.f90 
Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2025.0.4 Build 20241205
Copyright (C) 1985-2024 Intel Corporation. All rights reserved.

 Intel(R) Fortran 25.0-1205.1
/media/vmshare/nopass-func-len.f90(6): error #8237: The character length in a component declaration shall either be a colon, be an initialization expression, or be a specification expression.   [JUSTIFY]
        procedure(i_justify), pointer, nopass :: justify => null()
-------------------------------------------------^
compilation aborted for /media/vmshare/nopass-func-len.f90 (code 1)

 

(Due to an issue with Intel's GPG key in the latest Debian, I cannot check whether the issue persists in ifx v2025.1)

 

A Google search on the error pointed me to an old post of mine, but that one's about PDTs, so maybe the compiler is getting confused here?

0 Kudos
2 Replies
Ron_Green
Moderator
426 Views

This issue persists.  After I study this a little more I'll write up a bug report.

Ron_Green
Moderator
359 Views

The bug ID is CMPLRLLVM-67771

0 Kudos
Reply