summaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authornicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-15 18:15:35 +0000
committernicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-15 18:15:35 +0000
commit394dd73761e0c7385e999fbe280a75de96eda267 (patch)
tree4be690823fed9a5422c76137ffd4ee6054c70b90 /gcc/c-decl.c
parent815dcf5d5a64370d4fd66c9c5d8b0d8288ee2349 (diff)
downloadgcc-394dd73761e0c7385e999fbe280a75de96eda267.tar.gz
In gcc/c-family/:
2011-04-15 Nicola Pero <nicola.pero@meta-innovation.com> * c-objc.h (objc_get_interface_ivars): Removed. (objc_detect_field_duplicates): New. * stub-objc.c: Likewise. In gcc/: 2011-04-15 Nicola Pero <nicola.pero@meta-innovation.com> * c-decl.c (detect_field_duplicates): Call objc_detect_field_duplicates instead of objc_get_interface_ivars. In gcc/objc/: 2011-04-15 Nicola Pero <nicola.pero@meta-innovation.com> * objc-act.c (objc_get_interface_ivars): Removed. (objc_detect_field_duplicates): New. (hash_instance_variable): New. (eq_instance_variable): New. In gcc/objcp/: 2011-04-15 Nicola Pero <nicola.pero@meta-innovation.com> * objcp-decl.c (objcp_finish_struct): Use objc_detect_field_duplicates instead of having a local implementation. In gcc/testsuite/: 2011-04-15 Nicola Pero <nicola.pero@meta-innovation.com> * objc.dg/naming-4.m: Updated. * objc.dg/naming-5.m: Updated. * objc.dg/naming-6.m: New. * objc.dg/naming-7.m: New. * obj-c++.dg/naming-1.mm: Updated. * obj-c++.dg/naming-2.mm: Updated. * obj-c++.dg/naming-3.mm: New. * obj-c++.dg/naming-4.mm: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172511 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 34362788826..ce6fd2ab364 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -6829,15 +6829,19 @@ detect_field_duplicates (tree fieldlist)
int timeout = 10;
/* If the struct is the list of instance variables of an Objective-C
- class, then we need to add all the instance variables of
- superclasses before checking for duplicates (since you can't have
+ class, then we need to check all the instance variables of
+ superclasses when checking for duplicates (since you can't have
an instance variable in a subclass with the same name as an
- instance variable in a superclass). objc_get_interface_ivars()
- leaves fieldlist unchanged if we are not in this case, so in that
- case nothing changes compared to C.
- */
+ instance variable in a superclass). We pass on this job to the
+ Objective-C compiler. objc_detect_field_duplicates() will return
+ false if we are not checking the list of instance variables and
+ the C frontend should proceed with the standard field duplicate
+ checks. If we are checking the list of instance variables, the
+ ObjC frontend will do the check, emit the errors if needed, and
+ then return true. */
if (c_dialect_objc ())
- fieldlist = objc_get_interface_ivars (fieldlist);
+ if (objc_detect_field_duplicates (false))
+ return;
/* First, see if there are more than "a few" fields.
This is trivially true if there are zero or one fields. */