This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47710] New: [OOP] Improve ambiguity check for TBP
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 12 Feb 2011 09:03:49 +0000
- Subject: [Bug fortran/47710] New: [OOP] Improve ambiguity check for TBP
- Auto-submitted: auto-generated
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