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

ELEMENTAL FUNCTION as type bound procedure?

Jon_D
New Contributor II
680 Views
Are ELEMENTAL functions allowed as type bound procedures in F2003? The attached code compiles (IVF 11.1.035) and runs to completion except that the second call to getstate procedure prints out all zeros.

Thanks for any help,
Jon
0 Kudos
4 Replies
IanH
Honored Contributor III
680 Views
I couldn't find anything that said it would be illegal Fortran (and if it was, you'd expect a diagnostic from the compiler).

Looking at the disassembly it looks like a code generation problem. There's no "call" in the disassembly to getstate with:

INTEGER tmp(5)
tmp = a%getstate()

while there is with

tmp = getstate(a)

My understanding is that the two assignment statements should be equivalent. The second variety gives what I'd expect as the correct result.

0 Kudos
Steven_L_Intel1
Employee
680 Views
Thanks for reporting this. As is commonly the case with major new language features, there are some corners we missed looking into. I'll report this to the developers. The issue ID is DPD200137424.
0 Kudos
Steven_L_Intel1
Employee
680 Views
I expect the fix for this bug to appear in an update within the next month.
0 Kudos
Steven_L_Intel1
Employee
680 Views
This problem was corrected in 11.1 Update 2.
0 Kudos
Reply