1 // RUN: %clang_cc1 -fsyntax-only -verify -pedantic -std=c++11 %s
4 extern int scanf(const char *restrict, ...);
5 extern int printf(const char *restrict, ...);
8 void f(char **sp, float *fp) {
9 scanf("%as", sp); // expected-warning{{format specifies type 'float *' but the argument has type 'char **'}}
12 scanf("%afoobar", fp);
14 printf(*sp); // expected-warning {{not a string literal}}
19 R"bazquux(d)bazquux" // expected-warning {{more '%' conversions than data arguments}}
22 printf(u8"this is %d test", 0); // ok
25 %d)foo" // expected-warning {{more '%' conversions than data arguments}}
28 printf("init list: %d", { 0 }); // expected-error {{cannot pass initializer list to variadic function; expected type from format string was 'int'}}
29 printf("void: %d", f(sp, fp)); // expected-error {{cannot pass expression of type 'void' to variadic function; expected type from format string was 'int'}}
30 printf(0, { 0 }); // expected-error {{cannot pass initializer list to variadic function}}