Fariborz Jahanian | d66f22d | 2009-05-19 17:08:59 +0000 | [diff] [blame] | 1 | // RUN: clang-cc %s -fsyntax-only -verify -fblocks |
| 2 | |
| 3 | int 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 | |