diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-05-04 21:08:37 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-05-04 21:08:37 +0200 |
commit | 97e3c92355da5e885866e65dd1c1c6903f8611c2 (patch) | |
tree | 712eb1e1c6c928d4e2b998213eec287d48427ae5 /gcc/c-parser.c | |
parent | b5c0a77ec9b02f51b566ffbca83d02333932c064 (diff) | |
download | gcc-97e3c92355da5e885866e65dd1c1c6903f8611c2.zip gcc-97e3c92355da5e885866e65dd1c1c6903f8611c2.tar.gz gcc-97e3c92355da5e885866e65dd1c1c6903f8611c2.tar.bz2 |
re PR c/43981 (-Wunused-but-set-variable does not consider array sizing use of a variable)
PR c/43981
* c-parser.c (c_parser_direct_declarator_inner): Call mark_exp_read
on dimen.
* gcc.dg/Wunused-var-8.c: New test.
From-SVN: r159044
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r-- | gcc/c-parser.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c index cbdee1e..e5440d4 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -2474,6 +2474,8 @@ c_parser_direct_declarator_inner (c_parser *parser, bool id_present, "expected %<]%>"); return NULL; } + if (dimen) + mark_exp_read (dimen); declarator = build_array_declarator (brace_loc, dimen, quals_attrs, static_seen, star_seen); if (declarator == NULL) |