public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Pedro Alves <palves@redhat.com>
Cc: David Malcolm <dmalcolm@redhat.com>,
	gcc-patches List <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: <CADzB+2nxQ5Swi-SXHacVU8yGKh=FrTnO0Sp+18cP3Z-J4xpc2A@mail.gmail.com> (raw)
In-Reply-To: <f0e254d6-6cb0-713b-884c-20b7bf80e605@redhat.com>

On Fri, May 6, 2016 at 1:56 PM, Pedro Alves <palves@redhat.com> wrote:
> On 05/06/2016 05:40 PM, David Malcolm wrote:
>> +#if __cplusplus >= 201103
>> +/* C++11 claims to be available: use it: */
>> +#define OVERRIDE override
>> +#define FINAL final
>> +#else
>> +/* No C++11 support; leave the macros empty: */
>> +#define OVERRIDE
>> +#define FINAL
>> +#endif
>> +
>
> Is there a reason this is preferred over using override/final in
> the sources directly, and then define them away as empty
> on pre-C++11?
>
> I mean:
>
> #if __cplusplus < 201103
> # define override
> # define final
> #endif
>
> then use override/final throughout instead of OVERRIDE/FINAL.

This would break any existing use of those identifiers; they are not
keywords, so a variable named "final" is perfectly valid C++11.

Jason

  reply	other threads:[~2016-05-06 20:47 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 ` Pedro Alves
2016-01-01  0:00   ` Jason Merrill [this message]
2016-01-01  0:00   ` Pedro Alves
2016-01-01  0:00     ` Trevor Saunders
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                   ` Gerald Pfeifer
2017-01-01  0:00                     ` Trevor Saunders
2016-01-01  0:00       ` [PATCH 1/2] Add OVERRIDE and FINAL macros to coretypes.h Pedro Alves
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 Jakub Jelinek
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

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='CADzB+2nxQ5Swi-SXHacVU8yGKh=FrTnO0Sp+18cP3Z-J4xpc2A@mail.gmail.com' \
    --to=jason@redhat.com \
    --cc=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jit@gcc.gnu.org \
    --cc=palves@redhat.com \
    /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).