summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/attr-format.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-08-25 14:12:34 +0000
committerAnders Carlsson <andersca@mac.com>2009-08-25 14:12:34 +0000
commitbe96bc94e880dc319439ff783c90edd04b11b287 (patch)
tree47f3dd52b72a6b8aeba5677484b885bd352465a0 /clang/test/SemaCXX/attr-format.cpp
parent114056f22c060f8978c403a094fd95c76962e17e (diff)
downloadbcm5719-llvm-be96bc94e880dc319439ff783c90edd04b11b287.tar.gz
bcm5719-llvm-be96bc94e880dc319439ff783c90edd04b11b287.zip
Handle the implicit 'this' parameter for format attributes.
llvm-svn: 79987
Diffstat (limited to 'clang/test/SemaCXX/attr-format.cpp')
-rw-r--r--clang/test/SemaCXX/attr-format.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/attr-format.cpp b/clang/test/SemaCXX/attr-format.cpp
new file mode 100644
index 00000000000..d1659c98dee
--- /dev/null
+++ b/clang/test/SemaCXX/attr-format.cpp
@@ -0,0 +1,8 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+struct S {
+ static void f(const char*, ...) __attribute__((format(printf, 1, 2)));
+
+ // GCC has a hidden 'this' argument in member functions which is why
+ // the format argument is argument 2 here.
+ void g(const char*, ...) __attribute__((format(printf, 2, 3)));
+}; \ No newline at end of file
OpenPOWER on IntegriCloud