aboutsummaryrefslogtreecommitdiff
path: root/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
commitb30cd4a09bbf0adfa644b957a2b28fe31c5d45e4 (patch)
tree2575b4040d2b99238b79026ea5598fd034e876cf /test/Sema/format-strings.c
parent210c05b10317a11971f87e474ffa4c30bb8e4df9 (diff)
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>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133045 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/format-strings.c')
-rw-r--r--test/Sema/format-strings.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/Sema/format-strings.c b/test/Sema/format-strings.c
index c78095a04d..35210c341a 100644
--- a/test/Sema/format-strings.c
+++ b/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'}}
+}