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

Possible bug with type bound procedures

MR
Beginner
903 Views
The following code does not compile: ifort abc.f90 -o abc abc.f90(23): error #6580: Name in only-list does not exist. [T_ADD] use abc, only: t, t_add -------------------^ Isn't the code fine? (just as a note, gfortran accepts it). ifort -V Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20100414 Package ID: l_cprof_p_11.1.072 module abc implicit none public :: t, t_add type t integer :: i contains procedure, pass(t_obj) :: add => t_add end type t contains pure subroutine t_add(t_obj,n) class(t), intent(inout) :: t_obj integer, intent(in) :: n t_obj%i = t_obj%i + n end subroutine t_add end module abc program p use abc, only: t, t_add implicit none end program p
0 Kudos
5 Replies
MR
Beginner
903 Views
(Sorry, the formatting was lost in my previous post.)

The following code does not compile:

ifort abc.f90 -o abc
abc.f90(23): error #6580: Name in only-list does not exist. [T_ADD]
use abc, only: t, t_add
-------------------^

Isn't the code fine? (just as a note, gfortran accepts it).

ifort -V
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20100414 Package ID: l_cprof_p_11.1.072

module abc
implicit none
public :: t, t_add

type t
integer :: i
contains
procedure, pass(t_obj) :: add => t_add
end type t

contains
pure subroutine t_add(t_obj,n)
class(t), intent(inout) :: t_obj
integer, intent(in) :: n

t_obj%i = t_obj%i + n
end subroutine t_add
end module abc

program p
use abc, only: t, t_add
implicit none
end program p
0 Kudos
Kevin_D_Intel
Employee
903 Views

I believe I have seen a similar report in the past that I'll see if I can dig up.

The example compiles when removing the "only: t, t_add" from the USE in the main program if that offers a work-around.

0 Kudos
Kevin_D_Intel
Employee
903 Views

The circumstances of the earlier sightings of this error were different. I reported this instance the Development.

(Internal tracking id: DPD200157976)

(Resolution Update on 11/30/2010): This defect is fixed in the Intel Fortran Composer XE 2011 initial release (12.0.0.084 - Linux)

0 Kudos
Kevin_D_Intel
Employee
903 Views
I confirmed this defect is fixed in the next major release that will be available in a couple of months.
0 Kudos
Kevin_D_Intel
Employee
903 Views
The Intel Fortran Composer XE 2011 initial release (12.0.0.084 - Linux) with the fix is available from the Intel Registration Center: https://registrationcenter.intel.com
0 Kudos
Reply