public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/49591] New: [OOP] Multiple identical specific procedures in type-bound generic not detected
@ 2011-06-30 12:53 burnus at gcc dot gnu.org
2011-08-04 16:50 ` [Bug fortran/49591] [OOP] Multiple identical specific procedures in type-bound operator " janus at gcc dot gnu.org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-06-30 12:53 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/49591] [OOP] Multiple identical specific procedures in type-bound operator not detected
2011-06-30 12:53 [Bug fortran/49591] New: [OOP] Multiple identical specific procedures in type-bound generic not detected burnus at gcc dot gnu.org
@ 2011-08-04 16:50 ` janus at gcc dot gnu.org
2011-08-04 19:36 ` burnus at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu.org @ 2011-08-04 16:50 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49591
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.08.04 16:49:55
Summary|[OOP] Multiple identical |[OOP] Multiple identical
|specific procedures in |specific procedures in
|type-bound generic not |type-bound operator not
|detected |detected
Ever Confirmed|0 |1
--- Comment #1 from janus at gcc dot gnu.org 2011-08-04 16:49:55 UTC ---
Adjusting title. The problem really only applies to (type-bound) *operators*,
right?
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/49591] [OOP] Multiple identical specific procedures in type-bound operator not detected
2011-06-30 12:53 [Bug fortran/49591] New: [OOP] Multiple identical specific procedures in type-bound generic not detected burnus at gcc dot gnu.org
2011-08-04 16:50 ` [Bug fortran/49591] [OOP] Multiple identical specific procedures in type-bound operator " janus at gcc dot gnu.org
@ 2011-08-04 19:36 ` burnus at gcc dot gnu.org
2011-08-04 19:40 ` burnus at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-08-04 19:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49591
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-08-04 19:36:03 UTC ---
I think I found the place where this example came from, though at that point it
probably was not yet on the server:
http://www.j3-fortran.org/doc/meeting/195/11-214.txt
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/49591] [OOP] Multiple identical specific procedures in type-bound operator not detected
2011-06-30 12:53 [Bug fortran/49591] New: [OOP] Multiple identical specific procedures in type-bound generic not detected burnus at gcc dot gnu.org
2011-08-04 16:50 ` [Bug fortran/49591] [OOP] Multiple identical specific procedures in type-bound operator " janus at gcc dot gnu.org
2011-08-04 19:36 ` burnus at gcc dot gnu.org
@ 2011-08-04 19:40 ` burnus at gcc dot gnu.org
2011-08-04 20:06 ` janus at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-08-04 19:40 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49591
--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-08-04 19:39:32 UTC ---
(In reply to comment #1)
> Adjusting title. The problem really only applies to (type-bound) *operators*,
> right?
No idea. The example is, but I don't know whether other generics are properly
checked for ambiguity or not.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/49591] [OOP] Multiple identical specific procedures in type-bound operator not detected
2011-06-30 12:53 [Bug fortran/49591] New: [OOP] Multiple identical specific procedures in type-bound generic not detected burnus at gcc dot gnu.org
` (2 preceding siblings ...)
2011-08-04 19:40 ` burnus at gcc dot gnu.org
@ 2011-08-04 20:06 ` janus at gcc dot gnu.org
2012-06-25 19:06 ` janus at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu.org @ 2011-08-04 20:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49591
--- Comment #4 from janus at gcc dot gnu.org 2011-08-04 20:05:28 UTC ---
(In reply to comment #3)
> (In reply to comment #1)
> > Adjusting title. The problem really only applies to (type-bound) *operators*,
> > right?
>
> No idea. The example is, but I don't know whether other generics are properly
> checked for ambiguity or not.
Well, I think they should be (but one should re-check this).
Anyway the second example (M2) is constructed in such a way that it only
applies to operators: One bound to a type, the other not. For generics one can
distinguish whether the type-bound version is called or not.
The first example (M1), on the other hand, could also be constructed with two
type-bound generics of same name, bound to different types. But then again, the
pass-argument can be determined uniquely, so there is no ambiguity about which
type-bound generic should be called.
For generics the situation is different due to the different syntax of
invocation (both operands could be the pass-argument).
When both versions are bound to the same specific procedure, one could as well
take a "so what?" POV, because it doesn't matter which version you call.
For me, the more problematic case is the one where both operators are bound to
different specifics, but with the same interface. There you have the same
ambiguity as to which one to call, but the results will differ depending on
your decision. This case we probably also fail to reject (haven't checked,
though).
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/49591] [OOP] Multiple identical specific procedures in type-bound operator not detected
2011-06-30 12:53 [Bug fortran/49591] New: [OOP] Multiple identical specific procedures in type-bound generic not detected burnus at gcc dot gnu.org
` (3 preceding siblings ...)
2011-08-04 20:06 ` janus at gcc dot gnu.org
@ 2012-06-25 19:06 ` janus at gcc dot gnu.org
2012-06-27 17:38 ` janus at gcc dot gnu.org
2012-06-27 17:51 ` janus at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu.org @ 2012-06-25 19:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49591
--- Comment #5 from janus at gcc dot gnu.org 2012-06-25 19:06:32 UTC ---
Note that this PR is basically a duplicate of PR 41951, which contains a test
case analogous to the M2 case.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/49591] [OOP] Multiple identical specific procedures in type-bound operator not detected
2011-06-30 12:53 [Bug fortran/49591] New: [OOP] Multiple identical specific procedures in type-bound generic not detected burnus at gcc dot gnu.org
` (4 preceding siblings ...)
2012-06-25 19:06 ` janus at gcc dot gnu.org
@ 2012-06-27 17:38 ` janus at gcc dot gnu.org
2012-06-27 17:51 ` janus at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu.org @ 2012-06-27 17:38 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49591
--- Comment #6 from janus at gcc dot gnu.org 2012-06-27 17:38:11 UTC ---
Author: janus
Date: Wed Jun 27 17:38:00 2012
New Revision: 189022
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189022
Log:
2012-06-27 Janus Weil <janus@gcc.gnu.org>
PR fortran/41951
PR fortran/49591
* interface.c (check_new_interface): Rename, add 'loc' argument,
make non-static.
(gfc_add_interface): Rename 'check_new_interface'
* gfortran.h (gfc_check_new_interface): Add prototype.
* resolve.c (resolve_typebound_intrinsic_op): Add typebound operator
targets to non-typebound operator list.
2012-06-27 Janus Weil <janus@gcc.gnu.org>
PR fortran/41951
PR fortran/49591
* gfortran.dg/typebound_operator_16.f03: New.
Added:
trunk/gcc/testsuite/gfortran.dg/typebound_operator_16.f03
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/interface.c
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/49591] [OOP] Multiple identical specific procedures in type-bound operator not detected
2011-06-30 12:53 [Bug fortran/49591] New: [OOP] Multiple identical specific procedures in type-bound generic not detected burnus at gcc dot gnu.org
` (5 preceding siblings ...)
2012-06-27 17:38 ` janus at gcc dot gnu.org
@ 2012-06-27 17:51 ` janus at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu.org @ 2012-06-27 17:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49591
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
AssignedTo|unassigned at gcc dot |janus at gcc dot gnu.org
|gnu.org |
--- Comment #7 from janus at gcc dot gnu.org 2012-06-27 17:51:10 UTC ---
Fixed with r189022. Closing.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-06-27 17:51 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-30 12:53 [Bug fortran/49591] New: [OOP] Multiple identical specific procedures in type-bound generic not detected burnus at gcc dot gnu.org
2011-08-04 16:50 ` [Bug fortran/49591] [OOP] Multiple identical specific procedures in type-bound operator " janus at gcc dot gnu.org
2011-08-04 19:36 ` burnus at gcc dot gnu.org
2011-08-04 19:40 ` burnus at gcc dot gnu.org
2011-08-04 20:06 ` janus at gcc dot gnu.org
2012-06-25 19:06 ` janus at gcc dot gnu.org
2012-06-27 17:38 ` janus at gcc dot gnu.org
2012-06-27 17:51 ` janus 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).