aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/Wunused-var-14.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-08-26 16:37:22 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2011-08-26 16:37:22 +0200
commitf1a89dd00ccfb6e77ecec7203f40653b53a93cff (patch)
tree413636b1ba12d92675262e9fef4b7c81c3aab4d0 /gcc/testsuite/c-c++-common/Wunused-var-14.c
parentfd3e0a33c7df8b478e10c3d4ac6af11e77aae425 (diff)
downloadgcc-f1a89dd00ccfb6e77ecec7203f40653b53a93cff.zip
gcc-f1a89dd00ccfb6e77ecec7203f40653b53a93cff.tar.gz
gcc-f1a89dd00ccfb6e77ecec7203f40653b53a93cff.tar.bz2
re PR c/50179 (wrong "set but not used" warning)
PR c/50179 * c-typeck.c (c_process_expr_stmt): Skip over nops and call mark_exp_read even if exprv is ADDR_EXPR. * c-c++-common/Wunused-var-14.c: New test. From-SVN: r178110
Diffstat (limited to 'gcc/testsuite/c-c++-common/Wunused-var-14.c')
-rw-r--r--gcc/testsuite/c-c++-common/Wunused-var-14.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/Wunused-var-14.c b/gcc/testsuite/c-c++-common/Wunused-var-14.c
new file mode 100644
index 0000000..389feba
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/Wunused-var-14.c
@@ -0,0 +1,13 @@
+/* PR c/50179 */
+/* { dg-options "-Wunused" } */
+/* { dg-do compile } */
+
+void bar (int, ...);
+
+char *
+foo (void)
+{
+ bar (1, (__extension__ ({ static char b[2]; b[0] = 1; b; })));
+ bar (1, ({ static char c[2]; c[0] = 1; c; }));
+ return ({ static char d[2]; d[0] = 1; d; });
+}