[cfe-dev] Unicode support bug in Clang++-5.0

Hubert Tong via cfe-dev cfe-dev at lists.llvm.org
Sun Apr 8 04:37:39 PDT 2018


Quoth the Standard:

> Each universal-character-name in an identifier shall designate a character
> whose encoding in ISO 10646 falls into one of the ranges specified in Table
> 2.
>

\u3010 is in a gap between the allowed ranges 3004-3007 and 3021-302F.
The error message could be better.

-- HT


On Sun, Apr 8, 2018 at 1:25 AM, via cfe-dev <cfe-dev at lists.llvm.org> wrote:

> The code below compiles:
>
> class 字
> {
> };
>
> ===========================================
>
> But the code below results in a compilation error:
>
> class 【字】
> {
>
> };
>
> 測.cpp:1:7: error: non-ASCII characters are not allowed outside of
> literals and identifiers
> class 【字】
>       ^~
> 測.cpp:1:13: error: non-ASCII characters are not allowed outside of
> literals and identifiers
> class 【字】
>           ^~
>
> But obviously I am using "【" and "】" in a class identifier, why does
> Clang++ complains?
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180408/fa83e3ab/attachment.html>


More information about the cfe-dev mailing list