From 42dd5772382a0d211f3351788c61b3219640ca7b Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Fri, 18 Apr 2008 22:43:39 +0000 Subject: fix __attribute__(format) for struct function pointer fields llvm-svn: 49938 --- clang/test/Sema/format-attribute.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/test') diff --git a/clang/test/Sema/format-attribute.c b/clang/test/Sema/format-attribute.c index df3e4b59591..8eefe3f0654 100644 --- a/clang/test/Sema/format-attribute.c +++ b/clang/test/Sema/format-attribute.c @@ -17,3 +17,8 @@ void z(char *str, int c, ...) __attribute__((format(strftime, 1,2))); // expecte int (*f_ptr)(char*,...) __attribute__((format(printf, 1,2))); // no-error int (*f2_ptr)(double,...) __attribute__((format(printf, 1, 2))); // expected-error {{format argument not a string type}} + +struct _mystruct { + int (*printf)(const char *format, ...) __attribute__((__format__(printf, 1, 2))); // no-error + int (*printf2)(double format, ...) __attribute__((__format__(printf, 1, 2))); // expected-error {{format argument not a string type}} +}; -- cgit v1.2.3