diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-05-11 20:12:28 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-05-11 20:12:28 +0200 |
commit | 056928b248b7e3f879c2b3ac4be935e67ad3a09a (patch) | |
tree | 89061f89197477311627b0ab6424fa6ee67aaf52 /gcc/ChangeLog | |
parent | edf86ec148f98f12a16ba9b2a26b0b66b6078c50 (diff) | |
download | gcc-056928b248b7e3f879c2b3ac4be935e67ad3a09a.zip gcc-056928b248b7e3f879c2b3ac4be935e67ad3a09a.tar.gz gcc-056928b248b7e3f879c2b3ac4be935e67ad3a09a.tar.bz2 |
re PR c++/44062 ((void)var; doesn't prevent 'set but not used' warning)
PR c++/44062
* c-parser.c (c_parser_expression): Mark LHS of a comma
expression as read if it is a decl, handled component or
COMPOUND_EXPR with that on the RHS.
* c-typeck.c (c_process_expr_stmt): Mark RHS of COMPOUND_EXPR
if it is a decl or handled component.
* semantics.c (finish_expr_stmt): Don't call mark_exp_read here...
* cvt.c (convert_to_void): ... but here. If expr is a COMPOUND_EXPR,
look at its second operand.
* c-c++-common/Wunused-var-7.c: New test.
* g++.dg/warn/Wunused-var-9.C: New test.
From-SVN: r159286
Diffstat (limited to 'gcc/ChangeLog')
-rw-r--r-- | gcc/ChangeLog | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4f370ef..712b437 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2010-05-11 Jakub Jelinek <jakub@redhat.com> + + PR c++/44062 + * c-parser.c (c_parser_expression): Mark LHS of a comma + expression as read if it is a decl, handled component or + COMPOUND_EXPR with that on the RHS. + * c-typeck.c (c_process_expr_stmt): Mark RHS of COMPOUND_EXPR + if it is a decl or handled component. + 2010-05-11 Jan Hubicka <jh@suse.cz> * lto-symtab.c (lto_symtab_free): New function. |