This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Revision 3: utf-16 and utf-32 support in C and C++
- From: Kris Van Hees <kris dot van dot hees at oracle dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Kris Van Hees <kris dot van dot hees at oracle dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>, Andrew Pinski <pinskia at gmail dot com>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 15 Apr 2008 18:37:54 -0400
- Subject: Re: [PATCH] Revision 3: utf-16 and utf-32 support in C and C++
- References: <20080415200017.GA3887@oracle.com> <48051EF6.4000107@redhat.com>
On Tue, Apr 15, 2008 at 05:32:38PM -0400, Jason Merrill wrote:
> Kris Van Hees wrote:
>> - The types are created regardless of the compiler mode, yet they are not
>> registered as builtin types unless C++0x mode is enabled. Disabling the
>> recognition of the char16_t/char32_t keywords in non-C++0x mode was not
>> sufficient to ensure the compiler would not use these types.
>
> It wasn't? Where did the uses from then?
Well, when it encounters the identifier (char16_t or char32_t), it first checks
to see if it is a keyword (which it isn't for non-C++0x). If it isn't a known
keyword, it follows the (rather lengthy) path of name lookup, that eventually
terminates when it finds the registered builtin type. It took me quite a bit
to actually figure that out. As a result, blocking that from interpreting the
identifiers as types (when they are registered as builtin types) would involve
quite nasty special-casing code at the parser level. It seems much cleaner to
just not register them unless the compiler mode is C++0x.
Cheers,
Kris