3 // { dg-options "-Wall" }
8 V(int, const char *, ...) __attribute__((format(printf, 3, 4)));
12 D(int, const char *, ...) __attribute__((format(printf, 3, 4)));
17 D2(T, const char *, ...) __attribute__((format(printf, 3, 4)));
20 struct V2 : virtual B {
22 V2(T, const char *, ...) __attribute__((format(printf, 3, 4)));
27 X(T, ...) __attribute__((format(printf, 2, 3)));
30 V v(1, "%s %d", "foo", 1);
31 D d(1, "%s %d", "foo", 1);
32 D2 d2(1, "%s %d", "foo", 1);
33 V2 v2(1, "%s %d", "foo", 1);
35 // Test that it actually works.
36 V e1(1, "%d", 1L); // { dg-warning "expects argument of type" }
37 D e2(1, "%d", 1L); // { dg-warning "expects argument of type" }
38 X e3("%d", 1L); // { dg-warning "expects argument of type" }