diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-06-05 16:49:16 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-06-05 16:49:16 +0200 |
commit | 82c3c067975d090a1b7f9921235ec100f737c95f (patch) | |
tree | eb4ca6c522e22367819f9b64abc3885b7bbafe6b /gcc/c-parser.c | |
parent | 9f7b464b44cb23e0a7ede9748c89b5021100f6e1 (diff) | |
download | gcc-82c3c067975d090a1b7f9921235ec100f737c95f.tar.gz |
re PR c++/44361 (-Wunused-but-set-variable vs. explicit void cast)
PR c++/44361
* c-typeck.c (mark_exp_read): Handle C_MAYBE_CONST_EXPR.
* c-parser.c (c_parser_postfix_expression): Call mark_exp_read on
statement expression.
* c-c++-common/Wunused-var-9.c: New test.
From-SVN: r160317
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r-- | gcc/c-parser.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c index b30b0636ec0..21f5675cdbb 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -5601,6 +5601,7 @@ c_parser_postfix_expression (c_parser *parser) pedwarn (loc, OPT_pedantic, "ISO C forbids braced-groups within expressions"); expr.value = c_finish_stmt_expr (brace_loc, stmt); + mark_exp_read (expr.value); } else if (c_token_starts_typename (c_parser_peek_2nd_token (parser))) { |