From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3520 invoked by alias); 19 Apr 2002 13:26:10 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 3464 invoked by uid 71); 19 Apr 2002 13:26:04 -0000 Resent-Date: 19 Apr 2002 13:26:04 -0000 Resent-Message-ID: <20020419132604.3463.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, pietzowski@byterider.biz Received:(qmail 31667 invoked by uid 61); 19 Apr 2002 13:21:45 -0000 Message-Id:<20020419132145.31666.qmail@sources.redhat.com> Date: Fri, 19 Apr 2002 06:26:00 -0000 From: pietzowski@byterider.biz Reply-To: pietzowski@byterider.biz To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/6373: Reimplementation of virtual functions in the same class works (should normally not)gcc version 2.95.3 20010315 (SuSE) X-SW-Source: 2002-04/txt/msg00973.txt.bz2 List-Id: >Number: 6373 >Category: c++ >Synopsis: Reimplementation of virtual functions in the same class works (should normally not)gcc version 2.95.3 20010315 (SuSE) >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri Apr 19 06:26:02 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Andreas Pietzowski >Release: gcc version 2.95.3 20010315 (SuSE) >Organization: >Environment: SuSE-Linux 8.0 >Description: Hi, I program code for KDE with Qt under Linux. Qt has e.g a class QTable and in there they implemented this method virtual void QTable::activateNextCell(){ // some code here } Now it is possible that I write in my code: void QTable::activateNextCell(){ // some other code } and my reimplementation compiles and is used by the executable. Under Windows with Borlans bcc it isn't used. The guys from Trolltech (the founders of Qt) told me I should report this behaviour to you because a compiler should never allow a reimplementation of a method of the same class (only if you create a sub-class). Could you follow me? Was it enough info? If not please contact me via email and I'll try to explain it more detailed. >How-To-Repeat: >Fix: A warning would be enough I think because the behavior of a compiler is not defined in that case I think. And prehaps don't use the reimplemented code because there is already an original implementation. >Release-Note: >Audit-Trail: >Unformatted: