blob: ce30b8e855b7da1cce7962d3153b3061fabeb062 [file] [log] [blame]
Fariborz Jahaniand66f22d2009-05-19 17:08:59 +00001// RUN: clang-cc %s -fsyntax-only -verify -fblocks
2
3int main()
4{
5 void (^b) (int arg, const char * format, ...) __attribute__ ((__format__ (__printf__, 1, 3))) = // expected-error {{format argument not a string type}}
6 ^ __attribute__ ((__format__ (__printf__, 1, 3))) (int arg, const char * format, ...) {}; // expected-error {{format argument not a string type}}
7
8 void (^z) (int arg, const char * format, ...) __attribute__ ((__format__ (__printf__, 2, 3))) = ^ __attribute__ ((__format__ (__printf__, 2, 3))) (int arg, const char * format, ...) {};
9
10 // FIXME: argument type poking not yet supportted.
11 z(1, "%s", 1); /* { dg-warning "format \\'\%s\\' expects type \\'char \\*\\'\, but argument 3 has type \\'int\\'" } */
12 z(1, "%s", "HELLO"); // OK
13
14}
15