summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/format-strings.c
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-06-15 05:45:11 +0000
committerDouglas Gregor <dgregor@apple.com>2011-06-15 05:45:11 +0000
commit88336839b9cc1ab2c572693df8ff058c16906d0a (patch)
treeb844f210e917959f1710fae231acc02e006da95b /clang/test/Sema/format-strings.c
parent0e9fb28e9555c57478cffc3efdfc4fab6a651c1b (diff)
downloadbcm5719-llvm-88336839b9cc1ab2c572693df8ff058c16906d0a.tar.gz
bcm5719-llvm-88336839b9cc1ab2c572693df8ff058c16906d0a.zip
Don't add redundant FormatAttr, ConstAttr, or NoThrowAttr attributes,
either imlicitly (for builtins) or explicitly (due to multiple specification of the same attributes). Fixes <rdar://problem/9612060>. llvm-svn: 133045
Diffstat (limited to 'clang/test/Sema/format-strings.c')
-rw-r--r--clang/test/Sema/format-strings.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/Sema/format-strings.c b/clang/test/Sema/format-strings.c
index c78095a04d7..35210c341a5 100644
--- a/clang/test/Sema/format-strings.c
+++ b/clang/test/Sema/format-strings.c
@@ -358,3 +358,8 @@ void pr9314() {
printf(__func__); // no-warning
}
+int printf(const char * restrict, ...) __attribute__((__format__ (__printf__, 1, 2)));
+
+void rdar9612060(void) {
+ printf("%s", 2); // expected-warning{{conversion specifies type 'char *' but the argument has type 'int'}}
+}
OpenPOWER on IntegriCloud