This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/69566] Failure of SELECT TYPE with unlimited polymorphic function result


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69566

Paul Thomas <pault at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |pault at gcc dot gnu.org
            Summary|[6 Regression] ICE with     |Failure of SELECT TYPE with
                   |unlimited polymorphic array |unlimited polymorphic
                   |pointer function            |function result

--- Comment #4 from Paul Thomas <pault at gcc dot gnu.org> ---
The bug that is uncovered by the above fix is:
  print *, associated(return_pointer()) ! ICE
contains
  function return_pointer()
    class(*), pointer :: return_pointer(:)
    allocate (return_pointer, source = [1.0,2.0])
    select type (return_pointer)
      type is (real(4))
        print *, return_pointer
    end select
  end function
end

./pr69566/pr69566.f90:7:23:

       type is (real(4))
                       1
Error: Associate-name â__tmp_REAL_4â at (1) is used as array

This does not occur if the function has an explicit result.

I have seen this one before :-(

Paul

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]