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/49591] [OOP] Multiple identical specific procedures in type-bound operator not detected


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).


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