summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/objc/ChangeLog6
-rw-r--r--gcc/objc/objc-act.c2
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/obj-c++.dg/selector-warn-1.mm16
-rw-r--r--gcc/testsuite/objc.dg/selector-warn-1.m16
5 files changed, 45 insertions, 1 deletions
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index 42f50c2fa13..7b424391dd0 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,9 @@
+2011-01-17 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ PR objc/47314
+ * objc-act.c (finish_objc): When calling check_duplicates to check
+ duplicated instance methods, set 'is_class' to 0, not 1.
+
2011-01-14 Ben Elliston <bje@au.ibm.com>
PR 19162
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index cfbdb6f6134..33d39b222f4 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -12986,7 +12986,7 @@ finish_objc (void)
for (hsh = cls_method_hash_list[slot]; hsh; hsh = hsh->next)
check_duplicates (hsh, 0, 1);
for (hsh = nst_method_hash_list[slot]; hsh; hsh = hsh->next)
- check_duplicates (hsh, 0, 1);
+ check_duplicates (hsh, 0, 0);
}
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2509e229558..ad331343653 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2011-01-17 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ PR objc/47314
+ * objc.dg/selector-warn-1.m: New.
+ * obj-c++.dg/selector-warn-1.mm: New.
+
2011-01-17 Richard Sandiford <rdsandiford@googlemail.com>
* gcc.dg/tree-ssa/vrp51.c: Prefix each "bug." string with "vrp.".
diff --git a/gcc/testsuite/obj-c++.dg/selector-warn-1.mm b/gcc/testsuite/obj-c++.dg/selector-warn-1.mm
new file mode 100644
index 00000000000..b4b308d7b70
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/selector-warn-1.mm
@@ -0,0 +1,16 @@
+/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, January 2011. */
+/* { dg-options "-Wselector" } */
+/* { dg-do compile } */
+
+#include <objc/objc.h>
+
+@interface RootObject
+@end
+
+@interface MyObject : RootObject
+- (void) method; /* { dg-message "found" } */
+@end
+
+@interface MyObject2 : RootObject
+- (int) method; /* { dg-message "also found" } */
+@end /* { dg-warning "multiple selectors named .-method. found" } */
diff --git a/gcc/testsuite/objc.dg/selector-warn-1.m b/gcc/testsuite/objc.dg/selector-warn-1.m
new file mode 100644
index 00000000000..b4b308d7b70
--- /dev/null
+++ b/gcc/testsuite/objc.dg/selector-warn-1.m
@@ -0,0 +1,16 @@
+/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, January 2011. */
+/* { dg-options "-Wselector" } */
+/* { dg-do compile } */
+
+#include <objc/objc.h>
+
+@interface RootObject
+@end
+
+@interface MyObject : RootObject
+- (void) method; /* { dg-message "found" } */
+@end
+
+@interface MyObject2 : RootObject
+- (int) method; /* { dg-message "also found" } */
+@end /* { dg-warning "multiple selectors named .-method. found" } */