aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/FixIt/format.m14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/FixIt/format.m b/test/FixIt/format.m
index d9589a0148..c4747019b2 100644
--- a/test/FixIt/format.m
+++ b/test/FixIt/format.m
@@ -79,3 +79,17 @@ void test_class_correction (Class x) {
// CHECK: fix-it:"{{.*}}":{75:11-75:14}:"%@"
}
+
+typedef enum : int { NSUTF8StringEncoding = 8 } NSStringEncoding;
+void test_fixed_enum_correction(NSStringEncoding x) {
+ NSLog(@"%@", x); // expected-warning{{format specifies type 'id' but the argument has type 'NSStringEncoding'}}
+ // CHECK: fix-it:"{{.*}}":{85:11-85:13}:"%d"
+}
+
+typedef __SIZE_TYPE__ size_t;
+enum SomeSize : size_t { IntegerSize = sizeof(int) };
+void test_named_fixed_enum_correction(enum SomeSize x) {
+ NSLog(@"%@", x); // expected-warning{{format specifies type 'id' but the argument has type 'enum SomeSize'}}
+ // CHECK: fix-it:"{{.*}}":{92:11-92:13}:"%zu"
+}
+