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/47710] New: [OOP] Improve ambiguity check for TBP


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

           Summary: [OOP] Improve ambiguity check for TBP
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org
                CC: janus@gcc.gnu.org


http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/9a2837d8aee4e38c

There is potentially a problem with the ambiguity check for TBP of the form

  procedure, nopass :: baseproc_nopass => baseproc
  procedure, pass   :: baseproc_pass => baseproc 

That is: Both TBP point to the same procedure, though through the PASS and
NOPASS they should be distinguishable.

It is a bit unclear whether this is valid - also Richard Maine is confused ;-)
One might want to ask at J3 - maybe up to an interpretation request.

  * * *

Janus' example (cf. also below) should be truly ambiguous:

module mod

  type base_t
  contains
    procedure, nopass :: baseproc_nopass => baseproc1
    procedure, pass   :: baseproc_pass => baseproc2
    generic           :: some_proc => baseproc_pass, baseproc_nopass
  end type

contains

  subroutine baseproc1 (this)
    class(base_t) :: this
    print *, 'baseproc1'
  end subroutine

  subroutine baseproc2 (this,that)
    class(base_t) :: this, that
    print *, 'baseproc2'
  end subroutine

end module

program p
  use mod
  type(base_t) :: t

  call t%some_proc(t)  ! ambiguous!!!
end program


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