summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/format-strings-enum.c
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2014-05-31 04:12:14 +0000
committerJordan Rose <jordan_rose@apple.com>2014-05-31 04:12:14 +0000
commitbc53ed1ee6241b58c52768546d39897e62e7a7b7 (patch)
treeb1c8afbbddc2d6330ac43e10af57185758003ae3 /clang/test/Sema/format-strings-enum.c
parentb0a8b4ac5ff6802b22311ae895257b95693eb902 (diff)
downloadbcm5719-llvm-bc53ed1ee6241b58c52768546d39897e62e7a7b7.tar.gz
bcm5719-llvm-bc53ed1ee6241b58c52768546d39897e62e7a7b7.zip
Format strings: check against an enum's underlying type.
This allows us to be more careful when dealing with enums whose fixed underlying type requires special handling in a format string, like NSInteger. A refinement of r163266 from a year and a half ago, which added the special handling for NSInteger and friends in the first place. <rdar://problem/16616623> llvm-svn: 209966
Diffstat (limited to 'clang/test/Sema/format-strings-enum.c')
-rw-r--r--clang/test/Sema/format-strings-enum.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/Sema/format-strings-enum.c b/clang/test/Sema/format-strings-enum.c
index a6c27d0b6eb..e79f8598ab4 100644
--- a/clang/test/Sema/format-strings-enum.c
+++ b/clang/test/Sema/format-strings-enum.c
@@ -20,7 +20,7 @@ void test(TestEnum input) {
printf("%d", input); // no-warning
printf("%d", Constant); // no-warning
- printf("%lld", input); // expected-warning{{format specifies type 'long long' but the argument has type 'TestEnum'}}
+ printf("%lld", input); // expected-warning-re{{format specifies type 'long long' but the argument has underlying type '{{(unsigned)?}} int'}}
printf("%lld", Constant); // expected-warning{{format specifies type 'long long'}}
}
@@ -28,7 +28,7 @@ void test(TestEnum input) {
typedef enum { LongConstant = ~0UL } LongEnum;
void testLong(LongEnum input) {
- printf("%u", input); // expected-warning{{format specifies type 'unsigned int' but the argument has type 'LongEnum'}}
+ printf("%u", input); // expected-warning{{format specifies type 'unsigned int' but the argument has underlying type}}
printf("%u", LongConstant); // expected-warning{{format specifies type 'unsigned int'}}
printf("%lu", input);
OpenPOWER on IntegriCloud