From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82107 invoked by alias); 10 Aug 2015 12:05:53 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 82098 invoked by uid 89); 10 Aug 2015 12:05:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: paperclip.tbsaunde.org Received: from tbsaunde.org (HELO paperclip.tbsaunde.org) (66.228.47.254) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 10 Aug 2015 12:05:51 +0000 Received: from iceball.corp.tor1.mozilla.com (unknown [23.233.68.71]) by paperclip.tbsaunde.org (Postfix) with ESMTPSA id 8923EC06B for ; Mon, 10 Aug 2015 12:05:49 +0000 (UTC) From: tbsaunde+gcc@tbsaunde.org To: gcc-patches@gcc.gnu.org Subject: [PATCH 1/2] add GCC_FINAL to ansidecl.h Date: Mon, 10 Aug 2015 12:05:00 -0000 Message-Id: <1439208314-7390-1-git-send-email-tbsaunde+gcc@tbsaunde.org> X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00454.txt.bz2 From: Trevor Saunders Hi, This allows classes and virtual functions to be marked as final if the compiler supports C++11, or is gcc 4.7 or later. bootstrapped + regtested on x86_64-linux-gnu, ok? Trev include/ChangeLog: 2015-08-10 Trevor Saunders * ansidecl.h (GCC_FINAL): New macro. --- include/ansidecl.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/ansidecl.h b/include/ansidecl.h index 224627d..6e4bfc2 100644 --- a/include/ansidecl.h +++ b/include/ansidecl.h @@ -313,6 +313,15 @@ So instead we use the macro below and test it against specific values. */ #define ENUM_BITFIELD(TYPE) unsigned int #endif + /* This is used to mark a class or virtual function as final. */ +#if __cplusplus >= 201103L +#define GCC_FINAL final +#elif GCC_VERSION >= 4007 +#define GCC_FINAL __final +#else +#define GCC_FINAL +#endif + #ifdef __cplusplus } #endif -- 2.4.0