111
|
1 /* PR c/59871 */
|
|
2 /* { dg-do compile } */
|
|
3 /* { dg-options "-Wunused" } */
|
|
4
|
|
5 extern int bar ();
|
|
6
|
|
7 void
|
|
8 foo (int *p, int i)
|
|
9 {
|
|
10 p[0] = (bar (), 1, bar ()); /* { dg-warning "right-hand operand of comma expression has no effect" } */
|
|
11 p[1] = (1, bar ()); /* { dg-warning "left-hand operand of comma expression has no effect" } */
|
|
12 bar (), 1, bar (); /* { dg-warning "right-hand operand of comma expression has no effect" } */
|
|
13 bar (), 1; /* { dg-warning "right-hand operand of comma expression has no effect" } */
|
|
14 1, bar (); /* { dg-warning "left-hand operand of comma expression has no effect" } */
|
|
15 (bar (), 1); /* { dg-warning "right-hand operand of comma expression has no effect" } */
|
|
16 bar (), 5 * i; /* { dg-warning "right-hand operand of comma expression has no effect" } */
|
|
17 (bar (), 5 * i); /* { dg-warning "right-hand operand of comma expression has no effect" } */
|
|
18 (bar (), (bar (), (bar (), (bar (), (bar (), (bar (), (bar (), 7))))))); /* { dg-warning "right-hand operand of comma expression has no effect" } */
|
|
19 bar (), (bar (), (bar (), (bar (), (bar (), (bar (), (bar (), 7)))))); /* { dg-warning "right-hand operand of comma expression has no effect" } */
|
|
20 bar (), (bar (), (bar (), (bar (), (bar (), (bar (), (7, bar ())))))); /* { dg-warning "left-hand operand of comma expression has no effect" } */
|
|
21 (bar (), (bar (), (bar (), (bar (), (bar (), (bar (), (7, bar ()))))))); /* { dg-warning "left-hand operand of comma expression has no effect" } */
|
|
22 }
|