This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Objective-C : Do not accept an object as parameter to a method (take 2)
- From: Devang Patel <dpatel at apple dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Nicola Pero <nicola at brainstorm dot co dot uk>, Stan Shebs <shebs at apple dot com>
- Date: Fri, 5 Jul 2002 10:24:34 -0700
- Subject: [PATCH] Objective-C : Do not accept an object as parameter to a method (take 2)
On Wednesday, July 3, 2002, at 09:36 AM, Stan Shebs wrote:
Technically, the patch hasn't been approved - I think I may have
given the impression in private mail that it was OK, but the
question of passing structures by value hadn't been resolved.
The error should just apply to ObjC objects, and the test needs
to be sharpened to objects only.
Following patch restricts the error for ObjC objects being used as
parameter
type for ObjC method only. This patch passes objc testsuite.
Devang
2002-07-03 Devang Patel <dpatel@apple.com>
* objc/objc-act.c (adjust_type_for_id_default): Do not allow ObjC
objects
as a parameter type for Objective-C methods.
Index: objc-act.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/objc/objc-act.c,v
retrieving revision 1.141
diff -c -3 -p -r1.141 objc-act.c
*** objc-act.c 2 Jul 2002 23:06:02 -0000 1.141
--- objc-act.c 4 Jul 2002 01:32:45 -0000
*************** adjust_type_for_id_default (type)
*** 4465,4471 ****
chain;
chain = TREE_CHAIN (chain))
{
! if (TREE_CODE (TREE_VALUE (chain)) == RECORD_TYPE
&& !(TREE_VALUE (type)
&& TREE_CODE (TREE_VALUE (type)) == INDIRECT_REF))
error ("can not use an object as parameter to a method\n");
--- 4465,4471 ----
chain;
chain = TREE_CHAIN (chain))
{
! if (TYPED_OBJECT (TREE_VALUE (chain))
&& !(TREE_VALUE (type)
&& TREE_CODE (TREE_VALUE (type)) == INDIRECT_REF))
error ("can not use an object as parameter to a method\n");