Handle peeling for alignment with masking
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.ext / attrib4.C
blob5c2f03e4ba1645c241b95f064435dac72e519c2f
1 // { dg-do assemble  }
2 // { dg-options "-Wformat" }
3 // Test that attributes are really applied to function declarations under
4 // various conditions.
5 // Contributed by Jason Merrill (jason@cygnus.com)
7 #define PF __attribute__ ((format (printf, 1, 2)))
9 struct A {
10   static PF void f (const char *, ...);
11   static PF void g (const char *, ...) { }
12   static void test ();
15 void PF h (const char *, ...);
16 void PF k (const char *, ...) { }
18 void A::test ()
20   f ("%f", 42);                 // { dg-warning "argument 2" }
21   g ("%f", 42);                 // { dg-warning "argument 2" }
22   h ("%f", 42);                 // { dg-warning "argument 2" }
23   k ("%f", 42);                 // { dg-warning "argument 2" }