From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58314 invoked by alias); 6 May 2016 16:20:59 -0000 Mailing-List: contact jit-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: Sender: jit-owner@gcc.gnu.org Received: (qmail 58291 invoked by uid 89); 6 May 2016 16:20:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.1 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.0 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=45pm, FINAL, H*Ad:U*jit X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com X-Authentication-Warning: tucnak.zalov.cz: jakub set sender to jakub@redhat.com using -f Date: Fri, 01 Jan 2016 00:00:00 -0000 From: Jakub Jelinek To: David Malcolm Cc: gcc-patches@gcc.gnu.org, jit@gcc.gnu.org Subject: Re: [PATCH 1/2] Add OVERRIDE and FINAL macros to coretypes.h Message-ID: <20160506162052.GR26501@tucnak.zalov.cz> Reply-To: Jakub Jelinek References: <1462552846-17096-1-git-send-email-dmalcolm@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1462552846-17096-1-git-send-email-dmalcolm@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-SW-Source: 2016-q2/txt/msg00002.txt.bz2 On Fri, May 06, 2016 at 12:40:45PM -0400, David Malcolm wrote: > C++11 adds the ability to add "override" after an implementation of a > virtual function in a subclass, to: > (A) document that this is an override of a virtual function > (B) allow the compiler to issue a warning if it isn't (e.g. a mismatch > of the type signature). > > Similarly, it allows us to add a "final" to indicate that no subclass > may subsequently override the vfunc. > > We use virtual functions in a few places (e.g. in the jit), so it would > be good to get this extra checking. > > This patch adds OVERRIDE and FINAL as macros to coretypes.h > allowing us to get this extra checking when compiling with a compiler > that implements C++11 or later (e.g. gcc 6 by default), > but without requiring C++11. Don't we also want CONSTEXPR similarly defined to constexpr for C++11 and above and nothing otherwise? Jakub