From 93fd0aad9c08b2317d65b76be56de4ffc540fdcd Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Sun, 3 Feb 2019 22:47:41 +0000 Subject: [PATCH] PR c/69661 - missing -Wsequence-point warning gcc/testsuite.ChangeLog: * c-c++-common/Wsequence-point-2.c: New test. From-SVN: r268504 --- gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/c-c++-common/Wsequence-point-2.c | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 gcc/testsuite/c-c++-common/Wsequence-point-2.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3bcef91f752..c186df74d48 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2019-02-03 Martin Sebor + PR c/69661 + * c-c++-common/Wsequence-point-2.c: New test. + PR c++/44648 * g++.dg/warn/Wunused-var-35.C: New test. diff --git a/gcc/testsuite/c-c++-common/Wsequence-point-2.c b/gcc/testsuite/c-c++-common/Wsequence-point-2.c new file mode 100644 index 00000000000..1e85e273e34 --- /dev/null +++ b/gcc/testsuite/c-c++-common/Wsequence-point-2.c @@ -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\\\]" } */ +} -- 2.30.2