diff options
author | Ted Kremenek <kremenek@apple.com> | 2013-10-15 05:25:17 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2013-10-15 05:25:17 +0000 |
commit | da2f405b0903ae21577b877ec49892e28eff0d0d (patch) | |
tree | fcb14f40d46c272a22cb442e5c3fae9496fbee7f /clang/test/SemaObjC/format-strings-objc.m | |
parent | ef9e993eaa9dd8cb5afe6e1efd2ed4cf5973a4c7 (diff) | |
download | bcm5719-llvm-da2f405b0903ae21577b877ec49892e28eff0d0d.tar.gz bcm5719-llvm-da2f405b0903ae21577b877ec49892e28eff0d0d.zip |
Special case '%C' handling in ObjC format strings to handle integer literals that can represent unicode characters
Fixes <rdar://problem/13991617>.
llvm-svn: 192673
Diffstat (limited to 'clang/test/SemaObjC/format-strings-objc.m')
-rw-r--r-- | clang/test/SemaObjC/format-strings-objc.m | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/format-strings-objc.m b/clang/test/SemaObjC/format-strings-objc.m index a63d17328d8..2667e3047aa 100644 --- a/clang/test/SemaObjC/format-strings-objc.m +++ b/clang/test/SemaObjC/format-strings-objc.m @@ -243,3 +243,8 @@ void testTypeOf(NSInteger dW, NSInteger dH) { NSLog(@"dW %d dH %d",({ __typeof__(dW) __a = (dW); __a < 0 ? -__a : __a; }),({ __typeof__(dH) __a = (dH); __a < 0 ? -__a : __a; })); // expected-warning 2 {{values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead}} } +void testUnicode() { + NSLog(@"%C", 0x2022); // no-warning + NSLog(@"%C", 0x202200); // expected-warning{{format specifies type 'unichar' (aka 'unsigned short') but the argument has type 'int'}} +} + |