1// Test that attributes are really applied to function declarations under
2// various conditions.
3// Contributed by Jason Merrill (jason@cygnus.com)
4// Special g++ Options: -Wformat
5// Build don't link:
6
7#define PF __attribute__ ((format (printf, 1, 2)))
8
9struct A {
10  static PF void f (char *, ...);
11  friend PF void g (char *, ...);
12  static void test ();
13};
14
15void PF h (char *, ...);
16void PF k (char *, ...) { }
17
18void A::test ()
19{
20  f ("%f", 42);			// WARNING -
21  g ("%f", 42);			// WARNING -
22  h ("%f", 42);			// WARNING -
23  k ("%f", 42);			// WARNING -
24}
25