Format string checking: selectively ignore implicit casts to 'int'
when checking if the format specifier matches the type of the data
argument and the length modifier indicates the data type is 'char' or
'short'.

llvm-svn: 94992
diff --git a/clang/test/Sema/format-strings.c b/clang/test/Sema/format-strings.c
index 02e39a4..a055bfe 100644
--- a/clang/test/Sema/format-strings.c
+++ b/clang/test/Sema/format-strings.c
@@ -162,6 +162,11 @@
   printf("%.", x);  // expected-warning{{incomplete format specifier}}
   printf("%f", 4); // expected-warning{{conversion specifies type 'double' but the argument has type 'int'}}
   printf("%qd", lli);
+  printf("hhX %hhX", (unsigned char)10); // no-warning
+  printf("llX %llX", (long long) 10); // no-warning
+  // This is fine, because there is an implicit conversion to an int.
+  printf("%d", (unsigned char) 10); // no-warning
+  printf("%d", (long long) 10); // expected-warning{{conversion specifies type 'int' but the argument has type 'long long'}}
 } 
 
 typedef struct __aslclient *aslclient;