OSDN Git Service

PR c++/44062
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 May 2010 18:12:28 +0000 (18:12 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 May 2010 18:12:28 +0000 (18:12 +0000)
commitb2af2a9379ee112dba523c35b735c160547845a2
tree89061f89197477311627b0ab6424fa6ee67aaf52
parent44dde2f3822397be818fe9d71a964608de9b2e2c
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159286 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/c-parser.c
gcc/c-typeck.c
gcc/cp/ChangeLog
gcc/cp/cvt.c
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/Wunused-var-7.c [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wunused-var-9.C [new file with mode: 0644]