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
diff --git a/clang/test/Sema/format-strings.c b/clang/test/Sema/format-strings.c
index c78095a..35210c3 100644
--- a/clang/test/Sema/format-strings.c
+++ b/clang/test/Sema/format-strings.c
@@ -358,3 +358,8 @@
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'}}
+}