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]

[PATCH, C++-1z] Implement N4197 - Adding u8 character literals


I apologize to all who got this earlier.
I forgot to send to the list.

This patch adds UTF-8 character literals to C++:

    auto c = u8'c';

This is mostly a straight forward preprocessor exercise.
I only allow these characters in -std=c++1z and -std=gnu++1z.
I figure we can expand that easily with or without some pedwarn.

In c-ada-specs.c/print_ada_macros() I just write these as a char constant rather than spelling the token. We could do the latter. You'd see the "u8" then I think. I couldn't find in the Ada test suite where this was exercised.

That's all that seems controversial to me.

Built and tested clean on x86_64-linux.

Ed


Attachment: CL_utf8char
Description: Text document

Attachment: patch_utf8char_5
Description: Text document


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