blob: 8d34ebdcc2fe4c5db20b8eeadb407d463851b4b5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */
/* { dg-do compile } */
/* { dg-additional-options "-Wno-objc-root-class" } */
/* Test that you get a warning when an unknown protocol attribute is ignored. */
#include <objc/objc.h>
__attribute__ ((unknown_attribute))
@protocol MyProtocol
- (id) new; /* { dg-warning "ignored" } */
@end
__attribute__ ((unknown_attribute))
@protocol MyProtocol2; /* { dg-warning "ignored" } */
/* Use the protocols to double-check that no more warnings are
generated. */
@interface MyClass <MyProtocol>
@end
int test (id <MyProtocol2> x)
{
if (@protocol (MyProtocol) == @protocol (MyProtocol2))
return 1;
if (x)
return 2;
return 3;
}
|