From 7c35d89dca9e7c867d51e0bda2d0b98b2e147c86 Mon Sep 17 00:00:00 2001 From: Nicola Pero Date: Wed, 8 Dec 2010 23:20:21 +0000 Subject: [PATCH] In gcc/objc/: 2010-12-08 Nicola Pero In gcc/objc/: 2010-12-08 Nicola Pero * objc-act.c (objc_finish_foreach_loop): Use error_at() instead of error() when printing an error about the iterating variable or collection not being an object. In gcc/testsuite/: 2010-12-08 Nicola Pero * objc.dg/foreach-6.m: Updated location of error messages. * objc.dg/foreach-7.m: Same change. From-SVN: r167610 --- gcc/objc/ChangeLog | 6 ++++++ gcc/objc/objc-act.c | 4 ++-- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/objc.dg/foreach-6.m | 14 +++++++------- gcc/testsuite/objc.dg/foreach-7.m | 4 ++-- 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index f3001e581fbd..09977270e2fb 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,9 @@ +2010-12-08 Nicola Pero + + * objc-act.c (objc_finish_foreach_loop): Use error_at() instead of + error() when printing an error about the iterating variable or + collection not being an object. + 2010-12-06 Nicola Pero * objc-act.c (objc_finish_foreach_loop): Mark the diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index f53055652eab..f760aad700a9 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -13246,13 +13246,13 @@ objc_finish_foreach_loop (location_t location, tree object_expression, tree coll if (!objc_type_valid_for_messaging (TREE_TYPE (object_expression), true)) { - error ("iterating variable in fast enumeration is not an object"); + error_at (location, "iterating variable in fast enumeration is not an object"); return; } if (!objc_type_valid_for_messaging (TREE_TYPE (collection_expression), true)) { - error ("collection in fast enumeration is not an object"); + error_at (location, "collection in fast enumeration is not an object"); return; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c0af4e337db3..c7e0e21769e4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-12-08 Nicola Pero + + * objc.dg/foreach-6.m: Updated location of error messages. + * objc.dg/foreach-7.m: Same change. + 2010-12-08 Richard Guenther Sebastian Pop diff --git a/gcc/testsuite/objc.dg/foreach-6.m b/gcc/testsuite/objc.dg/foreach-6.m index 3578b77aa62a..96b145365c1e 100644 --- a/gcc/testsuite/objc.dg/foreach-6.m +++ b/gcc/testsuite/objc.dg/foreach-6.m @@ -46,16 +46,16 @@ int main (void) ; for (12 in array) /* { dg-error "invalid iterating variable in fast enumeration" } */ - ; /* { dg-error "iterating variable in fast enumeration is not an object" } */ + ; /* { dg-error "iterating variable in fast enumeration is not an object" "" { target *-*-* } 48 } */ - for (object in 12) - ; /* { dg-error "collection in fast enumeration is not an object" } */ + for (object in 12) /* { dg-error "collection in fast enumeration is not an object" } */ + ; - for (object in invalid) - ; /* { dg-error "collection in fast enumeration is not an object" } */ + for (object in invalid) /* { dg-error "collection in fast enumeration is not an object" } */ + ; - for (invalid in [object enumerator]) - ; /* { dg-error "iterating variable in fast enumeration is not an object" } */ + for (invalid in [object enumerator]) /* { dg-error "iterating variable in fast enumeration is not an object" } */ + ; return 0; } diff --git a/gcc/testsuite/objc.dg/foreach-7.m b/gcc/testsuite/objc.dg/foreach-7.m index 5da940f620ee..4629d61e1c18 100644 --- a/gcc/testsuite/objc.dg/foreach-7.m +++ b/gcc/testsuite/objc.dg/foreach-7.m @@ -36,10 +36,10 @@ int main (void) id object = nil; for (typedef int my_typedef in array) /* { dg-error "declaration of non-variable" } */ - ; /* { dg-error "iterating variable in fast enumeration is not an object" } */ + ; /* { dg-error "iterating variable in fast enumeration is not an object" "" { target *-*-* } 38 } */ for (function () in nil) /* { dg-error "invalid iterating variable in fast enumeration" } */ - ; /* { dg-error "iterating variable in fast enumeration is not an object" } */ + ; /* { dg-error "iterating variable in fast enumeration is not an object" "" { target *-*-* } 41 } */ for (object_function () in nil) /* { dg-error "invalid iterating variable in fast enumeration" } */ ;