In gcc/objc/: 2011-01-17 Nicola Pero <nicola.pero@meta-innovation.com>
authorNicola Pero <nicola.pero@meta-innovation.com>
Mon, 17 Jan 2011 22:17:47 +0000 (22:17 +0000)
committerNicola Pero <nicola@gcc.gnu.org>
Mon, 17 Jan 2011 22:17:47 +0000 (22:17 +0000)
In gcc/objc/:
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.

In gcc/testsuite/:
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.

From-SVN: r168934

gcc/objc/ChangeLog
gcc/objc/objc-act.c
gcc/testsuite/ChangeLog
gcc/testsuite/obj-c++.dg/selector-warn-1.mm [new file with mode: 0644]
gcc/testsuite/objc.dg/selector-warn-1.m [new file with mode: 0644]

index 42f50c2fa139f3be7b11e04ae3f35900b5634561..7b424391dd03c98f1828ad36b7bd7edc12505c38 100644 (file)
@@ -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
index cfbdb6f613422eb1cfd3452b2db6673468889e92..33d39b222f4ee68beffb0423c481a75d3957e1ea 100644 (file)
@@ -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);
        }
     }
 
index 2509e229558247cbbbd8fb7cede4420ac07f2cdd..ad3313436538ef0a8b1f827edda45df23de4f950 100644 (file)
@@ -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 (file)
index 0000000..b4b308d
--- /dev/null
@@ -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 (file)
index 0000000..b4b308d
--- /dev/null
@@ -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" } */