From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8049 invoked by alias); 4 Aug 2011 20:06:01 -0000 Received: (qmail 8038 invoked by uid 22791); 4 Aug 2011 20:06:00 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 04 Aug 2011 20:05:46 +0000 From: "janus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/49591] [OOP] Multiple identical specific procedures in type-bound operator not detected X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: accepts-invalid X-Bugzilla-Severity: normal X-Bugzilla-Who: janus at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Thu, 04 Aug 2011 20:06:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-08/txt/msg00577.txt.bz2 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).