diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-11-17 18:02:24 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-11-17 18:02:24 +0000 |
commit | 6eedcc1b86a10b2690803fe5e0d134aa7e3df5a8 (patch) | |
tree | 44b15d47a770830190389749a7bd766daa1a5099 /clang/test/SemaCXX/format-attribute.cpp | |
parent | 8ce3321eb68bfc43564e863d4e030524ec7ecc68 (diff) | |
download | bcm5719-llvm-6eedcc1b86a10b2690803fe5e0d134aa7e3df5a8.tar.gz bcm5719-llvm-6eedcc1b86a10b2690803fe5e0d134aa7e3df5a8.zip |
Adjust format attribute index for implicit object arguments. Fixes PR5521.
llvm-svn: 89113
Diffstat (limited to 'clang/test/SemaCXX/format-attribute.cpp')
-rw-r--r-- | clang/test/SemaCXX/format-attribute.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/format-attribute.cpp b/clang/test/SemaCXX/format-attribute.cpp new file mode 100644 index 00000000000..a21ebe11306 --- /dev/null +++ b/clang/test/SemaCXX/format-attribute.cpp @@ -0,0 +1,8 @@ +// RUN: clang-cc -fsyntax-only -verify %s + +// PR5521 +struct A { void a(const char*,...) __attribute((format(printf,2,3))); }; +void b(A x) { + x.a("%d", 3); +} +struct X { void a(const char*,...) __attribute((format(printf,1,3))); }; // expected-error {{format argument not a string type}} |