objc-act.c (objc_finish_foreach_loop): Mark collection expression as read.

gcc/objc:

	* objc-act.c (objc_finish_foreach_loop): Mark collection expression
	as read.

gcc/testsuite:

	* objc.dg/foreach-1.m: Add "-Wall" to flags.

From-SVN: r168602
This commit is contained in:
Iain Sandoe 2011-01-08 20:32:32 +00:00
parent 046608a3e0
commit 5d19c15004
4 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2011-01-08 Iain Sandoe <iains@gcc.gnu.org>
* objc-act.c (objc_finish_foreach_loop): Mark collection expression
as read.
2011-01-02 H.J. Lu <hongjiu.lu@intel.com>
* objc-act.c (check_that_protocol_is_defined): Fix a typo.

View File

@ -13635,6 +13635,8 @@ objc_finish_foreach_loop (location_t location, tree object_expression, tree coll
t = build2 (MODIFY_EXPR, void_type_node, objc_foreach_collection_decl, collection_expression);
SET_EXPR_LOCATION (t, location);
append_to_statement_list (t, &BIND_EXPR_BODY (bind));
/* We have used 'collection_expression'. */
mark_exp_read (collection_expression);
/* __objc_foreach_enum_state.state = 0; */
t = build2 (MODIFY_EXPR, void_type_node, objc_build_component_ref (objc_foreach_enum_state_decl,

View File

@ -1,3 +1,7 @@
2011-01-08 Iain Sandoe <iains@gcc.gnu.org>
* objc.dg/foreach-1.m: Add "-Wall" to flags.
2011-01-08 Nicola Pero <nicola.pero@meta-innovation.com>
PR objc/47078

View File

@ -4,6 +4,7 @@
/* { dg-do run } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
/* { dg-additional-sources "../objc-obj-c++-shared/Object1.m" } */
/* { dg-options "-Wall" } */
#import "../objc-obj-c++-shared/Object1.h"