This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [Patch] [libstdc++] [constexpr] use macros in place of 'constexpr' to allow for disabling constexpr until fully supported by compiler
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: dev dot lists at jessamine dot co dot uk
- Cc: gcc-patches at gcc dot gnu dot org, libstdc++ <libstdc++ at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: Thu, 17 Feb 2011 17:11:21 +0100
- Subject: Re: [Patch] [libstdc++] [constexpr] use macros in place of 'constexpr' to allow for disabling constexpr until fully supported by compiler
- References: <3f47a1ba92b11724c7daafd3f4c15e75.squirrel@webmail.plus.net>
On 02/17/2011 03:06 PM, Adam Butcher wrote:
> Hi,
>
> The attached patch replaces occurrences of the plain word 'constexpr'
> with either the symbol _GLIBCXX_CONSTEXPR or the symbol
> _GLIBCXX_USE_CONSTEXPR, depending on whether the disabled replacement
> should be '' or 'const' respectively.
>
> This allows for disabling constexpr usage by the standard library in
> C++0x mode until issues such as
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47774 /
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46472 are resolved in the
> compiler.
>
> Note I have only changed files required to build the project I'm
> currently working on. Specifically std/limits and std/complex. There
> may be other occurrences of the plain word 'constexpr' that are not
> referenced by it.
>
Please always send library patches to the libstdc++ mailing list too
(and of course, at some point you will need a Copyright Assignment on
file...)
Anyway, about the technical point: currently the macros are just an
implementation detail, are *not* meant to be changed at will be the user
(among other things, note that they appear in *.cc files too...).
Anyway, if we are going to do what you are suggesting we have to do it
consistently everywhere and document it.
At the moment, I don't know *exactly* how serious are the front-end
issues you mentioned above (in the specific sense: how much C++03 code
using <limits>, <complex>, etc, which we care about, would break in
C++0x mode only because of the bugs), or if in principle could be fixed
in time for 4.6.0.
Missing further clarifications, I vote against the library-only changes.
Paolo.