[cfe-commits] [patch] Add support for 4-byte ucns like \U12345678

Chris Lattner clattner at apple.com
Tue Oct 5 21:21:44 PDT 2010


On Oct 3, 2010, at 11:19 PM, Nico Weber wrote:

> Sean Hunt requested that ucns > 0xffff should be converted to utf16 in
> addition to displaying a warning, and that there should be tests for
> the converted text. The attached revised patch adds these two things.

+++ test/Lexer/wchar-warns-in-c89.c	(revision 0)
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c89 -verify %s
+
+void f() {
+  (void)L"\u1234";  // expected-warning {{unicode escape sequences are only valid in C99 or C++}}
+}

Please add this to test/Lexer/c90.c.  Tests that can be checked with -verify should follow a functional grouping instead of having one test per file.


The patch to lib/Lex/LiteralSupport.cpp is greek[1] to me, but your output matches llvm-gcc... so... sounds great! Please commit! :-)

-Chris

[1] Hi Argiris :)





More information about the cfe-commits mailing list