Skip to content

Commit 649cfeb

Browse files
committed
Fix objc test
1 parent e139e68 commit 649cfeb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clang/test/SemaObjC/format-strings-objc.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ void test_toll_free_bridging(CFStringRef x, id y) {
203203
}
204204

205205
@interface Bar
206-
+ (void)log:(NSString *)fmt, ...;
206+
+ (void)log:(NSString *)fmt, ...; // #log
207207
+ (void)log2:(NSString *)fmt, ... __attribute__((format(NSString, 1, 2)));
208208
@end
209209

@@ -212,7 +212,8 @@ @implementation Bar
212212
+ (void)log:(NSString *)fmt, ... {
213213
va_list ap;
214214
va_start(ap,fmt);
215-
NSLogv(fmt, ap); // expected-warning{{format string is not a string literal}}
215+
NSLogv(fmt, ap); // expected-warning{{diagnostic behavior may be improved by adding the 'format(NSString, 1, 2)' attribute to the declaration of 'log:'}}
216+
// expected-note@#log {{'log:' declared here}}
216217
va_end(ap);
217218
}
218219

0 commit comments

Comments
 (0)