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: [C++ PATCH] C++0x static assertions


"Doug Gregor" <doug.gregor@gmail.com> writes:

| 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.

Yes, in C++98 and C++03 static_assert is an identifier but, it has
been known for quite some time that it is being proposed as keyword.
This also gives a heads-up about how much real ode is broken.  My
suspiciion is that except for testsuite failures....

| [*] At some point, we should start warning about these cases.

yes, this should be done -- I think Richard G. suggested
-Wc++0x-compat.  That is useful to have anyway.

-- Gaby


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