aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-08-27 14:37:30 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2019-08-27 14:37:30 +0200
commit6a07489267e55084c3d5e88b4e9591be25bf2bf6 (patch)
tree5232756c208bd045ce9f230aee7a9030453bd2e7 /gcc/testsuite
parent6c14d008122fcee4157be79a60f8d6685869ad19 (diff)
downloadgcc-6a07489267e55084c3d5e88b4e9591be25bf2bf6.zip
gcc-6a07489267e55084c3d5e88b4e9591be25bf2bf6.tar.gz
gcc-6a07489267e55084c3d5e88b4e9591be25bf2bf6.tar.bz2
re PR c++/91415 (Invalid warning for C++17 sequencing of shift operator E1<<E2.)
PR c++/91415 * c-common.c (verify_tree): For LSHIFT_EXPR, RSHIFT_EXPR, COMPONENT_REF and ARRAY_REF in cxx_dialect >= cxx17 mode handle it like COMPOUND_EXPR rather than normal expression. * g++.dg/warn/sequence-pt-4.C: New test. From-SVN: r274952
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/warn/sequence-pt-4.C21
2 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d0a30f9..64970b2 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-08-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/91415
+ * g++.dg/warn/sequence-pt-4.C: New test.
+
2019-08-27 Robin Dapp <rdapp@linux.ibm.com>
PR testsuite/91549
diff --git a/gcc/testsuite/g++.dg/warn/sequence-pt-4.C b/gcc/testsuite/g++.dg/warn/sequence-pt-4.C
new file mode 100644
index 0000000..e8b1e2c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/sequence-pt-4.C
@@ -0,0 +1,21 @@
+/* More sequence point warning tests */
+/* { dg-do compile } */
+/* { dg-options "-Wsequence-point" } */
+
+struct S { int a[10]; };
+void bar (int, int, int, int, int, int, int, int);
+
+int
+foo (int i, int x[10][10], int y[10], struct S z[10], struct S *w[10])
+{
+ int b = x[i++][i++]; /* { dg-warning "undefined" "sequence point warning" { target c++14_down } } */
+ int c = i++ << i++; /* { dg-warning "undefined" "sequence point warning" { target c++14_down } } */
+ int d = i++ >> i++; /* { dg-warning "undefined" "sequence point warning" { target c++14_down } } */
+ int e = i++ && i++;
+ int f = i++ ? i++ : i++;
+ int g = (i++, i++);
+ int h = z[i++].a[i++]; /* { dg-warning "undefined" "sequence point warning" { target c++14_down } } */
+ int j = w[i++]->a[i++]; /* { dg-warning "undefined" "sequence point warning" { target c++14_down } } */
+ bar (b, c, d, e, f,g, h, j);
+ return i;
+}