diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-09-07 19:25:39 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-09-07 19:25:39 +0000 |
commit | d61a5cefe6aa7f71d748299d7a4b3cfe14a70cea (patch) | |
tree | b618eef683a6cbba29b85ede8384561c37605a10 /test/Lexer | |
parent | 923d959b1770881908b60041bbf544ade3d88c35 (diff) | |
download | clang-d61a5cefe6aa7f71d748299d7a4b3cfe14a70cea.tar.gz |
PR38870: Add warning for zero-width unicode characters appearing in
identifiers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341700 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Lexer')
-rw-r--r-- | test/Lexer/unicode.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/Lexer/unicode.c b/test/Lexer/unicode.c index 30e353fa79..bebab82988 100644 --- a/test/Lexer/unicode.c +++ b/test/Lexer/unicode.c @@ -38,3 +38,10 @@ int n; = 3; // expected-warning {{treating Unicode character <U+037E> as identi int *n꞉꞉v = &n;; // expected-warning 2{{treating Unicode character <U+A789> as identifier character rather than as ':' symbol}} // expected-warning@-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; +// expected-warning@-1 {{identifier contains Unicode character <U+2060> that is invisible in some environments}} +// expected-warning@-2 {{identifier contains Unicode character <U+FEFF> that is invisible in some environments}} +// expected-warning@-3 {{identifier contains Unicode character <U+200D> 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}} |