From f0fc7be52568981d377ec6910013e75b39263276 Mon Sep 17 00:00:00 2001 From: Nicola Pero Date: Mon, 17 Jan 2011 22:17:47 +0000 Subject: [PATCH] In gcc/objc/: 2011-01-17 Nicola Pero In gcc/objc/: 2011-01-17 Nicola Pero 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 PR objc/47314 * objc.dg/selector-warn-1.m: New. * obj-c++.dg/selector-warn-1.mm: New. From-SVN: r168934 --- gcc/objc/ChangeLog | 6 ++++++ gcc/objc/objc-act.c | 2 +- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/obj-c++.dg/selector-warn-1.mm | 16 ++++++++++++++++ gcc/testsuite/objc.dg/selector-warn-1.m | 16 ++++++++++++++++ 5 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/obj-c++.dg/selector-warn-1.mm create mode 100644 gcc/testsuite/objc.dg/selector-warn-1.m 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 + + 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 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 + + PR objc/47314 + * objc.dg/selector-warn-1.m: New. + * obj-c++.dg/selector-warn-1.mm: New. + 2011-01-17 Richard Sandiford * 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 , January 2011. */ +/* { dg-options "-Wselector" } */ +/* { dg-do compile } */ + +#include + +@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 , January 2011. */ +/* { dg-options "-Wselector" } */ +/* { dg-do compile } */ + +#include + +@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" } */ -- 2.30.2