1 /* Check that sending messages to variables of type 'Class' does not involve instance methods,
2 unless they reside in root classes. */
3 /* Author: Ziemowit Laski <zlaski@apple.com> */
4 /* { dg-do compile } */
5 /* { dg-options "-Wstrict-selector-match" } */
7 #ifdef __NEXT_RUNTIME__
8 # include "../objc-obj-c++-shared/F-NSObject.h"
9 # define OBJECT NSObject
11 # include <objc/Object.h>
12 # include <objc/Protocol.h>
13 # define OBJECT Object
17 - (unsigned)port; /* { dg-line Base_port } */
20 @interface Derived: Base
22 + (Protocol *)port; /* { dg-line Derived_port_last } */
29 [receiver port]; /* { dg-warning "multiple methods named .\\+port. found" } */
30 /* { dg-message "using .\\-\\(unsigned( int)?\\)port." "" { target *-*-* } Base_port } */
31 /* { dg-message "also found .\\+\\(Protocol \\*\\)port." "" { target *-*-* } Derived_port_last } */
33 [receiver starboard]; /* { dg-warning "no .\\+starboard. method found" } */
34 /* { dg-warning "messages without a matching method signature will be assumed to return .id. and accept .\.\.\.. as arguments" "" { target *-*-* } 0 } */
36 [Class port]; /* { dg-error ".Class. is not an Objective\\-C class name or alias" } */