aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/format-strings.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/format-strings.c')
-rw-r--r--test/Sema/format-strings.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/Sema/format-strings.c b/test/Sema/format-strings.c
index afc9e9720c..5c30849059 100644
--- a/test/Sema/format-strings.c
+++ b/test/Sema/format-strings.c
@@ -502,8 +502,13 @@ void pr9751() {
printf("%a", (long double)0); // expected-warning{{format specifies type 'double' but the argument has type 'long double'}}
// Test braced char[] initializers.
- const char kFormat18[] = { "%lld" }; // expected-note{{format string is defined here}}}
+ const char kFormat18[] = { "%lld" }; // expected-note{{format string is defined here}}
printf(kFormat18, 0); // expected-warning{{format specifies type}}
+
+ // Make sure we point at the offending argument rather than the format string.
+ const char kFormat19[] = "%d"; // expected-note{{format string is defined here}}
+ printf(kFormat19,
+ 0.0); // expected-warning{{format specifies}}
}
// PR 9466: clang: doesn't know about %Lu, %Ld, and %Lx