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

Inconsistent association state for function returning pointer to a type

pwl_b
Beginner
358 Views

The following program compiled with ifort 13.0.1 20121010 returns "T F". Shouldn't the result be "F F"?

program assoc

  type :: abc
  end type abc

  class(abc), pointer :: p

  p => p_new()
  print *, associated(p), associated(p_new())

contains

  function p_new()
    type(abc), pointer :: p_new
    nullify(p_new)
  end function p_new

end program assoc

Best,
Paweł Biernat

0 Kudos
2 Replies
Steven_L_Intel1
Employee
358 Views
You are correct - ASSOCIATED is not returning the right result here. I have escalated this as issue DPD200238262 and will let you know of any progress.
0 Kudos
Steven_L_Intel1
Employee
358 Views

I expect the fix for this to appear in Update 3.

0 Kudos
Reply