diff options
author | Jakub Jelinek <jakub@redhat.com> | 2013-05-14 22:50:43 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2013-05-14 22:50:43 +0200 |
commit | f7716d57ce54f18ae5e44aed518bdb7d10af6b9f (patch) | |
tree | 70a20f47fc549fe51dcb4e3bc4b4b7e0a0bcda35 /gcc | |
parent | 71b04de2fb6c33227da78045728e52401081a759 (diff) | |
download | gcc-f7716d57ce54f18ae5e44aed518bdb7d10af6b9f.zip gcc-f7716d57ce54f18ae5e44aed518bdb7d10af6b9f.tar.gz gcc-f7716d57ce54f18ae5e44aed518bdb7d10af6b9f.tar.bz2 |
re PR c++/57274 (Bogus sequence-point warning in C++)
PR c++/57274
* c-common.c (verify_tree): Don't recurse into SIZEOF_EXPR.
* c-c++-common/Wsequence-point-1.c: New test.
From-SVN: r198903
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-family/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c-family/c-common.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/c-c++-common/Wsequence-point-1.c | 17 |
4 files changed, 28 insertions, 0 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 62e14d0..840a10e 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2013-05-14 Jakub Jelinek <jakub@redhat.com> + + PR c++/57274 + * c-common.c (verify_tree): Don't recurse into SIZEOF_EXPR. + 2013-05-10 Marc Glisse <marc.glisse@inria.fr> * c-common.c (vector_types_convertible_p): No TYPE_PRECISION for diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 8cc1248..7f5d316 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -3032,6 +3032,7 @@ verify_tree (tree x, struct tlist **pbefore_sp, struct tlist **pno_sp, switch (code) { case CONSTRUCTOR: + case SIZEOF_EXPR: return; case COMPOUND_EXPR: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9171c44..4f9e575 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-05-14 Jakub Jelinek <jakub@redhat.com> + + PR c++/57274 + * c-c++-common/Wsequence-point-1.c: New test. + 2013-05-14 Marc Glisse <marc.glisse@inria.fr> * g++.dg/ext/vector22.C: New testcase. diff --git a/gcc/testsuite/c-c++-common/Wsequence-point-1.c b/gcc/testsuite/c-c++-common/Wsequence-point-1.c new file mode 100644 index 0000000..60dd55b --- /dev/null +++ b/gcc/testsuite/c-c++-common/Wsequence-point-1.c @@ -0,0 +1,17 @@ +/* PR c++/57274 */ +/* { dg-do compile } */ +/* { dg-options "-Wsequence-point" } */ + +void foo (int, int); + +void +bar (int *x) +{ + foo (*x++, sizeof (*x)); /* { dg-bogus "may be undefined" } */ +} + +void +baz (int *x) +{ + foo (*x, sizeof (*x++) + sizeof (*x++)); /* { dg-bogus "may be undefined" } */ +} |