summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/format-attribute.c
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2008-03-25 23:01:48 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2008-03-25 23:01:48 +0000
commit623207d603653cf71d18b26d25ad79e2b7b096e5 (patch)
treeb9c78c1dcfb8f3004a29ffbf64ff66fccf6e610e /clang/test/Sema/format-attribute.c
parent5efdf8457fee9f8587c201ac67b80aca5cd050b7 (diff)
downloadbcm5719-llvm-623207d603653cf71d18b26d25ad79e2b7b096e5.tar.gz
bcm5719-llvm-623207d603653cf71d18b26d25ad79e2b7b096e5.zip
allow the format attribute to be specified in function pointer prototypes
# this is my first commit here, so please be gentle :) llvm-svn: 48807
Diffstat (limited to 'clang/test/Sema/format-attribute.c')
-rw-r--r--clang/test/Sema/format-attribute.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/test/Sema/format-attribute.c b/clang/test/Sema/format-attribute.c
index 0b166e3c4dc..df3e4b59591 100644
--- a/clang/test/Sema/format-attribute.c
+++ b/clang/test/Sema/format-attribute.c
@@ -14,3 +14,6 @@ void g(xpto c) __attribute__((format(printf, 1, 0))); // no-error
void y(char *str) __attribute__((format(strftime, 1,0))); // no-error
void z(char *str, int c, ...) __attribute__((format(strftime, 1,2))); // expected-error {{strftime format attribute requires 3rd parameter to be 0}}
+
+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}}
OpenPOWER on IntegriCloud