diff options
Diffstat (limited to 'test/Sema/format-strings-scanf.c')
-rw-r--r-- | test/Sema/format-strings-scanf.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/Sema/format-strings-scanf.c b/test/Sema/format-strings-scanf.c index d1374d4bf9..2e32a26ac5 100644 --- a/test/Sema/format-strings-scanf.c +++ b/test/Sema/format-strings-scanf.c @@ -68,6 +68,10 @@ void test_variants(int *i, const char *s, ...) { vsscanf(buf, "%[abc", ap); // expected-warning{{no closing ']' for '%[' in scanf format string}} } +void test_scanlist(int *ip) { + scanf("%[abc]", ip); // expected-warning{{conversion specifies type 'char *' but the argument has type 'int *'}} +} + void test_alloc_extension(char **sp, wchar_t **lsp) { /* Make sure "%a" gets parsed as a conversion specifier for float, * even when followed by an 's', 'S' or '[', which would cause it to be |