1 /* PR middle-end/92799 - ICE on a weakref function definition followed
2 by a declaration
3 { dg-do compile }
4 { dg-options "-Wall" } */
5
6 static __attribute__ ((weakref ("bar"))) void f0 (void) { } // { dg-warning "'weakref' attribute ignored because function is defined" }
7
8 extern void f0 (void);
9
10 void* use_f0 (void) { return f0; }
11
12
13 static __attribute__ ((weakref ("bar"))) void f1 (void) { } // { dg-warning "'weakref' attribute ignored because function is defined" }
14
15 static void f1 (void);
16
17 void* use_f1 (void) { return f1; }
18
19
20 static __attribute__ ((weakref ("bar"))) void f2 (void);
21
22 static void f2 (void) { } // { dg-error "redefinition" }
23
24 void* use_f2 (void) { return f2; }
25
26
27 static __attribute__ ((weakref ("bar"))) void f3 (void);
28
29 void f3 (void) { } // { dg-error "redefinition" }
30
31 void* use_f3 (void) { return f3; }