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" } { "" } } */
6 // { dg-additional-options "-Wno-objc-root-class" }
8 #include <objc/Protocol.h>
11 - (unsigned)port; /* { dg-line Base_port } */
14 @interface Derived: Base
16 + (Protocol *)port; /* { dg-line Derived_port_last } */
23 [receiver port]; /* { dg-warning "multiple methods named .\\+port. found" } */
24 /* { dg-message "using .\\-\\(unsigned( int)?\\)port." "" { target *-*-* } Base_port } */
25 /* { dg-message "also found .\\+\\(Protocol \\*\\)port." "" { target *-*-* } Derived_port_last } */
27 [receiver starboard]; /* { dg-warning "no .\\+starboard. method found" } */
28 /* { dg-warning "messages without a matching method signature will be assumed to return .id. and accept .\.\.\.. as arguments" "" { target *-*-* } 0 } */
30 [Class port]; /* { dg-error ".Class. is not an Objective\\-C class name or alias" } */