[Bug fortran/49591] New: [OOP] Multiple identical specific procedures in type-bound generic not detected
burnus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jun 30 12:53:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49591
Summary: [OOP] Multiple identical specific procedures in
type-bound generic not detected
Product: gcc
Version: 4.7.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
The first code ("module M1") is accepted without any error.
Expected: Diagnose that the generic operator (+) has two ambiguous specific
bindings, one to myadd_t the other to myadd_x.
Ditto for the second code ("M2"), which is also currently accepted.
module M1
type T
integer x
contains
procedure :: MyAdd_t => myadd
generic :: operator(+) => myAdd_t
end type T
type X
real q
contains
procedure, pass(b) :: MyAdd_x => myadd
generic :: operator(+) => myAdd_x
end type X
contains
integer function MyAdd ( A, B )
class(t), intent(in) :: A
class(x), intent(in) :: B
myadd = a%x + b%q
end function MyAdd
end module
module M2
interface operator(+)
procedure MyAdd
end interface
type T
integer x
contains
procedure :: MyAdd_t => myadd
generic :: operator(+) => myAdd_t
end type T
contains
integer function MyAdd ( A, B )
class(t), intent(in) :: A
real, intent(in) :: B
myadd = a%x + b
end function MyAdd
end module
More information about the Gcc-bugs
mailing list