summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/format-attribute.c
diff options
context:
space:
mode:
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