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

--- Comment #6 from markeggleston at gcc dot gnu.org ---
Created attachment 47688
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47688&action=edit
attempt to fix remaining issues

Initial attempt at fixing the remaining issues. See attached patch.

function f()
  intrinsic :: sin
  procedure(sin), pointer :: f
  f => sin
end function f

now has this error:

    3 |   procedure(sin), pointer :: f
      |                              1
Error: Procedure pointer 'f' at (1) shall not be elemental

function g()
  interface
    subroutine g()
    end subroutine g
  end interface
  pointer g
  real g   ! "cannot have a type"
end function

now has this error:

    7 |   real g   ! "cannot have a type"
      |        1
Error: Symbol 'g' at (1) cannot have a type

Is this error suitable or should it be something else?  While trying to get a
different error I found the following:

function g()
 interface
    subroutine g()
    end subroutine g
  end interface
  real g   ! "cannot have a type"
end function

gives theses errors:

pr39695-2.f90:6:8:

    6 |   real g   ! "cannot have a type"
      |        1
Error: Symbol 'g' at (1) cannot have a type
pr39695-2.f90:3:16:

    3 |     subroutine g()
      |                1
Error: PROCEDURE attribute conflicts with RESULT attribute in 'ppr@' at (1)

Note the 'ppr@' above. There may be more of them.

Reply via email to