From 8ed7776bc404719a43a9dc53283c7817ae5bfee0 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 7 Sep 2018 19:25:39 +0000 Subject: PR38870: Add warning for zero-width unicode characters appearing in identifiers. llvm-svn: 341700 --- clang/test/Lexer/unicode.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'clang/test/Lexer/unicode.c') diff --git a/clang/test/Lexer/unicode.c b/clang/test/Lexer/unicode.c index 30e353fa797..bebab829880 100644 --- a/clang/test/Lexer/unicode.c +++ b/clang/test/Lexer/unicode.c @@ -38,3 +38,10 @@ int n; = 3; // expected-warning {{treating Unicode character as identi int *n꞉꞉v = &n;; // expected-warning 2{{treating Unicode character as identifier character rather than as ':' symbol}} // expected-warning@-1 {{treating Unicode character 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 that is invisible in some environments}} +// expected-warning@-2 {{identifier contains Unicode character that is invisible in some environments}} +// expected-warning@-3 {{identifier contains Unicode character that is invisible in some environments}} +int foo​bar = 0; // expected-warning {{identifier contains Unicode character that is invisible in some environments}} +int x = foobar; // expected-error {{undeclared identifier}} -- cgit v1.2.3