This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Re: [C++ PATCH] C++0x static assertions
On 08 Nov 2006 14:25:31 +0100, Gabriel Dos Reis
<gdr@integrable-solutions.net> wrote:
"Doug Gregor" <doug.gregor@gmail.com> writes:
| On 07 Nov 2006 23:42:28 +0100, Gabriel Dos Reis
| <gdr@integrable-solutions.net> wrote:
| > Douglas Gregor <doug.gregor@gmail.com> writes:
| > could we simplify the ugliness and do without __static_assert, and
| > plain static_assert?
sorry, the above should read "use plain static_assert".
The issue is that with -std=c++98, "static_assert" is an identifier.
With -std=c++0x, "static_assert" is a keyword [*]. If we want to be
able to use static assertions in libstdc++ even when the user compiles
with -std=c++98, we can't use the "static_assert" keyword for them...
so the patch provides __static_assert as an alias. We do the same
thing with "typeof" and "__typeof" and "__typeof__" now.
If we don't care about this case, I'll eliminate the three lines of
code in the patch that implement this behavior.
Cheers,
Doug
[*] At some point, we should start warning about these cases.