This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/2] Add OVERRIDE and FINAL macros to coretypes.h


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]