Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

might be a bug?

dundar11
Beginner
577 Views
Hi,
Using latest intel fortran composer for linux (12.0.1)
When I use a component 's name of derived type as a procedure name
it will give internal compiler error instead of warning this mistake example:
type my_type
real :: alfa
contains
procedure :: alfa=> set_alfa
end my_type
0 Kudos
5 Replies
TimP
Honored Contributor III
577 Views
12.0.1 is far from the latest. There have been 6 more updates. Current is 12.1.1.
0 Kudos
Steven_L_Intel1
Employee
577 Views
The example you provide is incomplete and gets many valid syntax errors, even in 12.0. Can you show a real example that demonstrates the problem?
0 Kudos
dundar11
Beginner
577 Views
I am using 12.1.0
I was just trying to show the error.
Here is a piece from my code.
use element_map_module
TYPE, extends(elementmap):: element_parameters
integer :: n_elements
logical :: default_pars
character(len=3),dimension(:),allocatable :: element_symbol
integer,dimension(:),allocatable,private :: pm_ !for short range
END TYPE element_parameters
TYPE ,extends(element_parameters) :: bond_parameters
real(8),dimension(:),allocatable,private :: cs_ ,cl_ ! tersoff short range cutoff
real(8) :: cs
END TYPE bond_parameters
TYPE,extends(bond_parameters) :: carbon_parameters
real(8):: pacc, plamcc !additional pair-wise term
END TYPE carbon_parameters
TYPE,extends(carbon_parameters):: parameters
contains
procedure:: cs => get_cs
end type parameters
function get_cs(this) result(iostat)
class(parameters) :: this
integer :: iostat=0
end function
procedure name cs points to function get_cs
there is another real variable as a component of base type of parameters type.
Intuitively compiler supposed to give a syntax error but doesn't ...
instead it gives internal compiler error without stating any lines..
dundar.
0 Kudos
jimdempseyatthecove
Honored Contributor III
577 Views
If in your code snip function get_cs is in the same body of code (IOW part of a module) then you need CONTAINS in front of the function (true, an appropriate error message should have pointed this out).

What is the scope (contex) at which point in your code the"use element_map_module" resides?
(PROGRAM, FUNCTION, SUBROUTINE, MODULE, ...)
Whae is the scope (contex) at which point in your code the"function get_cs(this) result(iostat)" resides?

Jim Dempsey
0 Kudos
Steven_L_Intel1
Employee
577 Views
Dundar has provided me with a test case and I can reproduce the problem. It has to do with a reference to a generic, type-bound procedure, though there are obviously some other aspects as well.
0 Kudos
Reply