From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31046 invoked by alias); 21 Feb 2003 18:06:01 -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 31022 invoked by uid 71); 21 Feb 2003 18:06:01 -0000 Resent-Date: 21 Feb 2003 18:06:01 -0000 Resent-Message-ID: <20030221180601.31021.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, georgeh@aya.yale.edu Received: (qmail 30804 invoked by uid 48); 21 Feb 2003 18:05:49 -0000 Message-Id: <20030221180549.30803.qmail@sources.redhat.com> Date: Fri, 21 Feb 2003 18:06:00 -0000 From: georgeh@aya.yale.edu Reply-To: georgeh@aya.yale.edu To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/9791: -Woverloaded-virtual reports hiding of destructor X-SW-Source: 2003-02/txt/msg01075.txt.bz2 List-Id: >Number: 9791 >Category: c++ >Synopsis: -Woverloaded-virtual reports hiding of destructor >Confidential: no >Severity: non-critical >Priority: low >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri Feb 21 18:06:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: George Heintzelman >Release: gcc-3.2.2 >Organization: >Environment: Solaris 8 >Description: class Base { public: virtual ~Base() { } }; class Derived: public Base { public: int Base() { return 5; } }; int main() { } When compiled with -Woverloaded-virtual, this file produces: ../gcc-3.2.2/bin/g++ test-hiding.C -save-temps -Wall -Woverloaded-virtual test-hiding.C:3: warning: `virtual Base::~Base()' was hidden test-hiding.C:9: warning: by `int Derived::Base()' which is certainly not accurate. It is true that int Derived::Base() is hiding the name of the base class inside the class, but this is not the kind of name-hiding that (I think) the warning was intended to guard against; nor is it name-hiding that is likely to lead to an error. I think -Woverloaded-virtual should not give a warning in this case. >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: