/* Contributed by Nicola Pero , December 2010. */ /* { dg-do compile } */ #include /* Test that the compiler can correctly compare protocols in types of method signatures. In this test we look at protocols implementing other protocols. The fact that one protocol implements another one doesn't mean that they are identical. */ @protocol A - (void) doSomething; @end @protocol B - (void) doSomethingElse; @end @protocol C - (void) doYetSomethingElse; @end @interface MyClass2 - (void) aMethod: (id )x; /* { dg-message "previous declaration" } */ - (void) aMethod: (id )x; /* { dg-error "duplicate declaration" } */ - (void) bMethod: (id )x; /* { dg-message "previous declaration" } */ - (void) bMethod: (id )x; /* { dg-error "duplicate declaration" } */ - (void) cMethod: (id )x; - (void) cMethod: (id )x; /* Ok - because if you implement B, then you also implement A, so == */ - (void) dMethod: (id )x; - (void) dMethod: (id )x; /* Ok */ - (void) eMethod: (id )x; /* { dg-message "previous declaration" } */ - (void) eMethod: (id )x; /* { dg-error "duplicate declaration" } */ - (void) fMethod: (id )x; /* { dg-message "previous declaration" } */ - (void) fMethod: (id )x; /* { dg-error "duplicate declaration" } */ - (void) gMethod: (id )x; /* { dg-message "previous declaration" } */ - (void) gMethod: (id )x; /* { dg-error "duplicate declaration" } */ - (void) hMethod: (id )x; /* { dg-message "previous declaration" } */ - (void) hMethod: (id )x; /* { dg-error "duplicate declaration" } */ @end