From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11345 invoked by alias); 16 Nov 2012 12:33:25 -0000 Received: (qmail 11239 invoked by uid 48); 16 Nov 2012 12:33:03 -0000 From: "janus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/41951] [OOP] Not diagnosing ambiguous operators (TB vs. INTERFACE) Date: Fri, 16 Nov 2012 12:33:00 -0000 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 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: 2012-11/txt/msg01493.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41951 --- Comment #17 from janus at gcc dot gnu.org 2012-11-16 12:33:00 UTC --- (In reply to comment #16) > One way to reject the abstract case in comment 11, would be to just do the > checking, but not add the procedure to the operator list: The only problem with the patch in comment 16 is that the error message it gives on comment 11 ... generic :: assignment(=) => assign 1 Error: Entity 'assign_it' at (1) is already present in the interface ... is technically not correct. 'assign_it' is not added twice, but in one case is just the interface of the deferred type-boud procedure 'assign'. Instead, it might be better to complain about 'Ambiguous interfaces' (since any non-abstract extension of the type 'sort_t' will have to override/implement the type-bound 'assign' with a procedure which is ambiguous to 'assign_it'). However, such an error about 'Ambiguous interfaces' is also missing for the following case (which is still accepted): module m_sort implicit none type, abstract :: sort_t contains generic :: assignment(=) => assign procedure(assign_ifc), deferred :: assign end type abstract interface subroutine assign_ifc (lhs, rhs) import class(sort_t), intent(out) :: lhs class(sort_t), intent(in) :: rhs end subroutine end interface interface assignment(=) subroutine assign_it (lhs, rhs) import class(sort_t), intent(out) :: lhs class(sort_t), intent(in) :: rhs end subroutine end interface end module