[PATCH] D59765: [Lex] Warn about invisible Hangul whitespace
Brian Gesiak via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 25 06:42:29 PDT 2019
modocache updated this revision to Diff 192092.
modocache added a comment.
Remove unneeded change to test identifier 'xx'.
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59765/new/
https://reviews.llvm.org/D59765
Files:
lib/Lex/Lexer.cpp
test/Lexer/unicode.c
Index: test/Lexer/unicode.c
===================================================================
--- test/Lexer/unicode.c
+++ test/Lexer/unicode.c
@@ -39,10 +39,12 @@
// expected-warning at -1 {{treating Unicode character <U+037E> as identifier character rather than as ';' symbol}}
int v=[=](auto){return~x;}(); // expected-warning 12{{treating Unicode character}}
-int xx;
+int xxㅤᅠ;
// expected-warning at -1 {{identifier contains Unicode character <U+2060> that is invisible in some environments}}
// expected-warning at -2 {{identifier contains Unicode character <U+FEFF> that is invisible in some environments}}
// expected-warning at -3 {{identifier contains Unicode character <U+200D> that is invisible in some environments}}
+// expected-warning at -4 {{identifier contains Unicode character <U+3164> that is invisible in some environments}}
+// expected-warning at -5 {{identifier contains Unicode character <U+FFA0> that is invisible in some environments}}
int foobar = 0; // expected-warning {{identifier contains Unicode character <U+200B> that is invisible in some environments}}
int x = foobar; // expected-error {{undeclared identifier}}
Index: lib/Lex/Lexer.cpp
===================================================================
--- lib/Lex/Lexer.cpp
+++ lib/Lex/Lexer.cpp
@@ -1528,6 +1528,7 @@
{U'\u2227', '^'}, // LOGICAL AND
{U'\u2236', ':'}, // RATIO
{U'\u223c', '~'}, // TILDE OPERATOR
+ {U'\u3164', 0}, // HANGUL FILLER
{U'\ua789', ':'}, // MODIFIER LETTER COLON
{U'\ufeff', 0}, // ZERO WIDTH NO-BREAK SPACE
{U'\uff01', '!'}, // FULLWIDTH EXCLAMATION MARK
@@ -1558,6 +1559,7 @@
{U'\uff5c', '|'}, // FULLWIDTH VERTICAL LINE
{U'\uff5d', '}'}, // FULLWIDTH RIGHT CURLY BRACKET
{U'\uff5e', '~'}, // FULLWIDTH TILDE
+ {U'\uffa0', 0}, // HALFWIDTH HANGUL FILLER
{0, 0}
};
auto Homoglyph =
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59765.192092.patch
Type: text/x-patch
Size: 1933 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190325/05ffc0df/attachment-0001.bin>
More information about the cfe-commits
mailing list