From: Jakub Jelinek <jakub@redhat.com>
To: David Malcolm <dmalcolm@redhat.com>
Cc: gcc-patches@gcc.gnu.org, jit@gcc.gnu.org
Subject: Re: [PATCH 1/2] Add OVERRIDE and FINAL macros to coretypes.h
Date: Fri, 01 Jan 2016 00:00:00 -0000 [thread overview]
Message-ID: <20160506162052.GR26501@tucnak.zalov.cz> (raw)
In-Reply-To: <1462552846-17096-1-git-send-email-dmalcolm@redhat.com>
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
next prev parent reply other threads:[~2016-05-06 16:20 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-01 0:00 David Malcolm
2016-01-01 0:00 ` Jakub Jelinek [this message]
2016-01-01 0:00 ` CONSTEXPR macro (was "Re: [PATCH 1/2] Add OVERRIDE and FINAL macros to coretypes.h") David Malcolm
2016-01-01 0:00 ` Jakub Jelinek
2016-01-01 0:00 ` [PATCH 2/2] jit: use FINAL and OVERRIDE throughout David Malcolm
2016-01-01 0:00 ` David Malcolm
2016-01-01 0:00 ` [PATCH 1/2] Add OVERRIDE and FINAL macros to coretypes.h Pedro Alves
2016-01-01 0:00 ` Jason Merrill
2016-01-01 0:00 ` Pedro Alves
2016-01-01 0:00 ` Trevor Saunders
2016-01-01 0:00 ` Pedro Alves
2016-01-01 0:00 ` Move OVERRIDE/FINAL from gcc/coretypes.h to include/ansidecl.h (was: Re: [PATCH 1/2] Add OVERRIDE and FINAL macros to coretypes.h) Pedro Alves
2016-01-01 0:00 ` Move OVERRIDE/FINAL from gcc/coretypes.h to include/ansidecl.h Bernd Schmidt
2016-01-01 0:00 ` Pedro Alves
2016-01-01 0:00 ` Bernd Schmidt
2016-01-01 0:00 ` Pedro Alves
2016-01-01 0:00 ` [wwwdocs, coding conventions] Mention OVERRIDE/FINAL David Malcolm
2016-01-01 0:00 ` Pedro Alves
2017-01-01 0:00 ` Gerald Pfeifer
2017-01-01 0:00 ` Trevor Saunders
2017-01-01 0:00 ` Gerald Pfeifer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160506162052.GR26501@tucnak.zalov.cz \
--to=jakub@redhat.com \
--cc=dmalcolm@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jit@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).