OSDN Git Service

PR c++/44062
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 May 2010 18:12:28 +0000 (18:12 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:05:17 +0000 (14:05 +0900)
commit2483cbc4b4bf756afba17dd384dc6cbaee797b52
tree32a47565ceb3a9ed50b393e145d93634027b2e27
parentbbfc49e6d7a2840b67816856396b137dc6bb5a57
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-typeck.c
gcc/cp/ChangeLog
gcc/cp/cvt.c
gcc/cp/semantics.c
gcc/testsuite/ChangeLog