summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/format-attribute.c
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2008-04-18 22:43:39 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2008-04-18 22:43:39 +0000
commit42dd5772382a0d211f3351788c61b3219640ca7b (patch)
treed74a0e52882bb82a9a26f91e6e397418e829814f /clang/test/Sema/format-attribute.c
parent472cf88ef23bb145d48cb88de7dadafc036068fa (diff)
downloadbcm5719-llvm-42dd5772382a0d211f3351788c61b3219640ca7b.tar.gz
bcm5719-llvm-42dd5772382a0d211f3351788c61b3219640ca7b.zip
fix __attribute__(format) for struct function pointer fields
llvm-svn: 49938
Diffstat (limited to 'clang/test/Sema/format-attribute.c')
-rw-r--r--clang/test/Sema/format-attribute.c5
1 files changed, 5 insertions, 0 deletions
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}}
+};
OpenPOWER on IntegriCloud