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] Revision 3: utf-16 and utf-32 support in C and C++


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


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