1 /* Test for situations in which protocol conformance information
2 may be lost, leading to superfluous warnings. */
3 /* Author: Ziemowit Laski <zlaski@apple.com>. */
4 /* { dg-do compile } */
5 // { dg-additional-options "-Wno-objc-root-class" }
7 /* One-line substitute for objc/objc.h */
8 typedef struct objc_object { struct objc_class *class_pointer; } *id;
14 @interface NSObject <NSObject>
17 @protocol PlateMethods
22 NSObject <PlateMethods> *plate;
23 id <PlateMethods> plate1;
26 - (id <PlateMethods>) getPlate;
27 - (id <NSObject>) getPlate1;
32 - (id <PlateMethods>) getPlate {
33 return plate; /* { dg-bogus "does not implement" } */
35 - (id <NSObject>) getPlate1 {
36 return (id <NSObject>)plate1; /* { dg-bogus "does not conform" } */
39 int i = [plate1 someValue]; /* { dg-warning ".\\-someValue. not found in protocol\\(s\\)" } */
41 int j = [(id <NSObject>)plate1 someValue]; /* { dg-bogus "not found in protocol" } */
42 int k = [(id)plate1 someValue]; /* { dg-bogus "not found in protocol" } */