This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 1/2] Add OVERRIDE and FINAL macros to coretypes.h
- From: Pedro Alves <palves at redhat dot com>
- To: David Malcolm <dmalcolm at redhat dot com>, gcc-patches at gcc dot gnu dot org, jit at gcc dot gnu dot org
- Date: Fri, 6 May 2016 18:56:00 +0100
- Subject: Re: [PATCH 1/2] Add OVERRIDE and FINAL macros to coretypes.h
- Authentication-results: sourceware.org; auth=none
- References: <1462552846-17096-1-git-send-email-dmalcolm at redhat dot com>
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.
If building gcc as a C++11 program is supported, then it
won't be possible to use these names as symbols for
anything else anyway?
Thanks,
Pedro Alves