Daily bump.
[gcc.git] / gcc / testsuite / g++.dg / warn / Wformat-2.C
blobff8b54b48998df90dccdf13e796c5b292973ef52
1 // PR c++/84076
2 // { dg-do compile }
3 // { dg-options "-Wformat" }
5 struct S { ~S (); };
6 struct T { T (); T (const T &); };
8 void
9 foo ()
11   S s;
12   T t;
13   __builtin_printf ("%s\n", s); // { dg-warning "format '%s' expects argument of type 'char\\*', but argument 2 has type 'S'" }
14   __builtin_printf ("%s\n", t); // { dg-warning "format '%s' expects argument of type 'char\\*', but argument 2 has type 'T'" }
15   __builtin_printf ("%s\n", &s);// { dg-warning "format '%s' expects argument of type 'char\\*', but argument 2 has type 'S\\*'" }
16   __builtin_printf ("%s\n", &t);// { dg-warning "format '%s' expects argument of type 'char\\*', but argument 2 has type 'T\\*'" }