PR c/69661 - missing -Wsequence-point warning

gcc/testsuite.ChangeLog:
        * c-c++-common/Wsequence-point-2.c: New test.

From-SVN: r268504
This commit is contained in:
Martin Sebor 2019-02-03 22:47:41 +00:00 committed by Martin Sebor
parent 0b841214a8
commit 93fd0aad9c
2 changed files with 16 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2019-02-03 Martin Sebor <msebor@redhat.com>
PR c/69661
* c-c++-common/Wsequence-point-2.c: New test.
PR c++/44648
* g++.dg/warn/Wunused-var-35.C: New test.

View File

@ -0,0 +1,13 @@
/* PR c/69661 - missing -Wsequence-point warning
{ dg-do compile }
{ dg-options "-Wall" } */
int a, b;
short c;
void fn1 (int p) { (void)p; }
void fn2 (void)
{
fn1(a == (c &= a = b)); /* { dg-warning "\\\[-Wsequence-point\\\]" } */
}