OSDN Git Service

* lib/gcc-dg.exp (dg-skip-if): New function.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.ext / attrib4.C
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)
6
7 #define PF __attribute__ ((format (printf, 1, 2)))
8
9 struct A {
10   static PF void f (char *, ...);
11   friend PF void g (char *, ...);
12   static void test ();
13 };
14
15 void PF h (char *, ...);
16 void PF k (char *, ...) { }
17
18 void A::test ()
19 {
20   f ("%f", 42);                 // { dg-warning "" } 
21   g ("%f", 42);                 // { dg-warning "" } 
22   h ("%f", 42);                 // { dg-warning "" } 
23   k ("%f", 42);                 // { dg-warning "" } 
24 }