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
Showing
gcc/testsuite/c-c++-common/Wunused-var-7.c
0 → 100644
gcc/testsuite/g++.dg/warn/Wunused-var-9.C
0 → 100644
Please
register
or
sign in
to comment