Unicode support bug in Clang++-5.0

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Unicode support bug in Clang++-5.0

Manuel Klimek via cfe-dev
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
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Unicode support bug in Clang++-5.0

Manuel Klimek via cfe-dev
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 <[hidden email]> 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
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev