1 /* Test -Wunused-value. Bug 23113. */
2 /* Origin: Joseph Myers <joseph@codesourcery.com> */
3 /* { dg-do compile } */
4 /* { dg-options "-Wunused-value" } */
13 1 + f (); /* { dg-warning "value computed is not used" } */
14 f () + f (); /* { dg-warning "value computed is not used" } */
15 f () + f (), f (); /* { dg-warning "value computed is not used" } */
16 (char) f (); /* { dg-warning "value computed is not used" } */
20 *p
++; /* { dg-warning "value computed is not used" } */
24 /* Statement expressions may be used in macro expansions which like
25 functions return values which may or may not be of use, so don't
26 warn for them but do warn inside them. */
29 ({ f() + 1; 0; }); /* { dg-warning "value computed is not used" } */
30 1 + ({ f(); }); /* { dg-warning "value computed is not used" } */