Message ID | 1608710438.5502.2.camel@med.uni-goettingen.de |
---|---|
State | New |
Headers | show |
Series | [C,testsuite] bogus warning [P98029] | expand |
On 12/23/20 1:00 AM, Uecker, Martin wrote: > > With the fix to PR98047 "C: Drop qualifiers of assignment expressions." > also the new incorrect warning for assignment of certain volatile expressions > introduced by dropping qualifiers in lvalue conversion (PR97702) > disappeared [P98029]. This patch only adds a test case. > > -- Martin > > > C: Add test for incorrect warning for assignment of certain volatile > expressions fixed by commit 58a45ce [PR98029] > > 2020-12-12 Martin Uecker <muecker@gwdg.de> > > gcc/testsuite/ > PR c/98029 > * gcc.dg/pr98029.c: New test. OK jeff
On Wed, 23 Dec 2020, Uecker, Martin wrote: > With the fix to PR98047 "C: Drop qualifiers of assignment expressions." > also the new incorrect warning for assignment of certain volatile expressions > introduced by dropping qualifiers in lvalue conversion (PR97702) > disappeared [P98029]. This patch only adds a test case. > > -- Martin > > > C: Add test for incorrect warning for assignment of certain volatile > expressions fixed by commit 58a45ce [PR98029] > > 2020-12-12 Martin Uecker <muecker@gwdg.de> > > gcc/testsuite/ > PR c/98029 > * gcc.dg/pr98029.c: New test. OK.
diff --git a/gcc/testsuite/gcc.dg/pr98029.c b/gcc/testsuite/gcc.dg/pr98029.c new file mode 100644 index 00000000000..148f23ce5e0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr98029.c @@ -0,0 +1,21 @@ +/* pr98029 */ +/* { dg-do compile } */ +/* { dg-options "-Wunused" } */ + +double f2 (void) +{ + volatile double d; + int i; + + for (d = 2.0, i = 0; i < 5; i++, d *= d) /* { dg-bogus "right-hand operand of comma expression has no effect" } */ + ; + + return d; +} + +int g(void) +{ + volatile int x; + (x = 1, (void)1); /* { dg-bogus "right-hand operand of comma expression has no effect" } */ + return x;