1 /* Check that sending messages to variables of type 'Class' does not involve instance methods, unless they reside in root classes. */
2 /* Author: Ziemowit Laski <zlaski@apple.com> */
3 /* { dg-options "-Wstrict-selector-match" } */
4 /* { dg-do compile } */
5 /* { dg-skip-if "Object interface removed" { *-*-darwin[1-2]* && { lp64 } } { "-fnext-runtime" } { "" } } */
7 #include <objc/Protocol.h>
10 - (unsigned)port; /* { dg-line Base_port } */
13 @interface Derived: Base
15 + (Protocol *)port; /* { dg-line Derived_port_last } */
22 [receiver port]; /* { dg-warning "multiple methods named .\\+port. found" } */
23 /* { dg-message "using .\\-\\(unsigned( int)?\\)port." "" { target *-*-* } Base_port } */
24 /* { dg-message "also found .\\+\\(Protocol \\*\\)port." "" { target *-*-* } Derived_port_last } */
26 [receiver starboard]; /* { dg-warning "no .\\+starboard. method found" } */
27 /* { dg-warning "Messages without a matching method signature" "" { target *-*-* } .-1 } */
28 /* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } .-2 } */
29 /* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } .-3 } */
31 [Class port]; /* { dg-error ".Class. is not an Objective\\-C class name or alias" } */