From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2759 invoked by alias); 8 Jul 2009 10:23:19 -0000 Received: (qmail 2706 invoked by uid 48); 8 Jul 2009 10:23:09 -0000 Date: Wed, 08 Jul 2009 10:23:00 -0000 Message-ID: <20090708102309.2705.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/31397] Useful compiler warning missing (virtual functions in derived classes used without 'virtual') In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "Thomas dot Lange at sun dot com" 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: 2009-07/txt/msg00625.txt.bz2 ------- Comment #3 from Thomas dot Lange at sun dot com 2009-07-08 10:23 ------- (In reply to comment #2) > why don't you add a 'virtual' > to your destructor and int f(int) functions, because they are implicitly > virtual anyway'. That is exactly the point this is about! I want a way so the compiler enforces to add 'virtual' to ~B and B::f, and thus help to write better understandable code. This is in order for large derived trees or a big source code. It is for the one looking at the declaration (and not anymore or not at all familiar with the code!) to not miss that those functions are virtual. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31397