public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/54286] New: [4.8 Regression] Accepts invalid proc-pointer assignments involving proc-ptr function result
@ 2012-08-16 15:05 janus at gcc dot gnu.org
  2012-09-19 12:07 ` [Bug fortran/54286] " rguenth at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: janus at gcc dot gnu.org @ 2012-08-16 15:05 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54286

             Bug #: 54286
           Summary: [4.8 Regression] Accepts invalid proc-pointer
                    assignments involving proc-ptr function result
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: janus@gcc.gnu.org


The following test is probably invalid, but not rejected by recent trunk
versions:


type :: t
  procedure(a), pointer, nopass :: p
end type

type(t) :: x
procedure(iabs), pointer :: pp

x%p => a     ! ok
x%p => a(1)  ! invalid, but not rejected by 4.8

pp => a(2)   ! ok
pp => a      ! invalid, but not rejected by 4.8

contains

  function a (c) result (b)
    integer, intent(in) :: c
    procedure(iabs), pointer :: b
    b => iabs
  end function

end



gfortran 4.7 rejects it with:

x%p => a(1)
       1
Error: Interface mismatch in procedure pointer assignment at (1): Type/rank
mismatch in return value of 'b'

pp => a
      1
Error: Interface mismatch in procedure pointer assignment at (1): Type/rank
mismatch in return value of 'a'


However, I wonder why one of the errors refers to 'a' and the other to 'b'.
Also I'm not sure whether 'type/rank mismatch' is the correct diagnostic. I
would rather say there is a mismatch in the procedure pointer attribute of the
result (which is not checked for yet), cf. also PR 35831.


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-01-15  5:34 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-16 15:05 [Bug fortran/54286] New: [4.8 Regression] Accepts invalid proc-pointer assignments involving proc-ptr function result janus at gcc dot gnu.org
2012-09-19 12:07 ` [Bug fortran/54286] " rguenth at gcc dot gnu.org
2012-09-19 12:29 ` burnus at gcc dot gnu.org
2013-01-08 21:44 ` pault at gcc dot gnu.org
2013-01-09  9:44 ` pault at gcc dot gnu.org
2013-01-09 12:07 ` mikael at gcc dot gnu.org
2013-01-09 13:08 ` pault at gcc dot gnu.org
2013-01-13  8:58 ` pault at gcc dot gnu.org
2013-01-14  5:53 ` pault at gcc dot gnu.org
2013-01-14 20:32 ` pault at gcc dot gnu.org
2013-01-14 22:35 ` dominiq at lps dot ens.fr
2013-01-15  5:29 ` pault at gcc dot gnu.org
2013-01-15  5:34 ` pault at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).