1 /* PR c/99972 - missing -Wunused-result on a call to a locally redeclared
2 warn_unused_result function
4 { dg-options "-Wall" } */
6 void gwur_local_local (void)
8 __attribute__ ((warn_unused_result
)) int fwur1 (void);
10 fwur1 (); // { dg-warning "\\\[-Wunused-result" }
13 void hwur_local_local (void)
15 /* Verify the attribute from the declaration above is copied/merged
16 into the declaration below. */
19 fwur1 (); // { dg-warning "\\\[-Wunused-result" }
23 void gwur_local_global (void)
25 __attribute__ ((warn_unused_result
)) int fwur2 (void);
27 fwur2 (); // { dg-warning "\\\[-Wunused-result" }
32 void hwur_local_global (void)
34 fwur2 (); // { dg-warning "\\\[-Wunused-result" }
38 __attribute__ ((warn_unused_result
)) int fwur3 (void);
40 void gwur_global_local (void)
42 fwur3 (); // { dg-warning "\\\[-Wunused-result" }
45 void hwur_global_local (void)
49 fwur3 (); // { dg-warning "\\\[-Wunused-result" }