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 | |
parent | 9f7b464b44cb23e0a7ede9748c89b5021100f6e1 (diff) | |
download | gcc-82c3c067975d090a1b7f9921235ec100f737c95f.zip gcc-82c3c067975d090a1b7f9921235ec100f737c95f.tar.gz gcc-82c3c067975d090a1b7f9921235ec100f737c95f.tar.bz2 |
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')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/c-parser.c | 1 | ||||
-rw-r--r-- | gcc/c-typeck.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 |
4 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2c68d5b..6164ce7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2010-06-05 Jakub Jelinek <jakub@redhat.com> + + 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. + 2010-06-05 Jan Hubicka <jh@suse.cz> * df-problems.c (seen_in_block, seen_in_insn): Convert to bitmap_head. diff --git a/gcc/c-parser.c b/gcc/c-parser.c index b30b063..21f5675 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))) { diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 5a291de..103272c 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -1841,6 +1841,7 @@ mark_exp_read (tree exp) mark_exp_read (TREE_OPERAND (exp, 0)); break; case COMPOUND_EXPR: + case C_MAYBE_CONST_EXPR: mark_exp_read (TREE_OPERAND (exp, 1)); break; default: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9ba3e60..4bfe09f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-06-05 Jakub Jelinek <jakub@redhat.com> + + PR c++/44361 + * c-c++-common/Wunused-var-9.c: New test. + 2010-06-05 Jason Merrill <jason@redhat.com> * g++.dg/cpp0x/noexcept06.C: Call set_unexpected. |