Don't warn when a '%%' or '%*d' (scanf) is used in a format string with positional arguments, since
these don't actually consume an argument.
llvm-svn: 108757
diff --git a/clang/test/Sema/format-strings.c b/clang/test/Sema/format-strings.c
index c6dee68..080e4db 100644
--- a/clang/test/Sema/format-strings.c
+++ b/clang/test/Sema/format-strings.c
@@ -239,6 +239,8 @@
printf("%1$2.2d", (int) 2); // no-warning
printf("%2$*1$.2d", (int) 2, (int) 3); // no-warning
printf("%2$*8$d", (int) 2, (int) 3); // expected-warning{{specified field width is missing a matching 'int' argument}}
+ printf("%%%1$d", (int) 2); // no-warning
+ printf("%1$d%%", (int) 2); // no-warning
}
// PR 6697 - Handle format strings where the data argument is not adjacent to the format string