xref: /llvm-project/clang/test/SemaObjC/conditional-expr-7.m (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
1// RUN: %clang_cc1 -fsyntax-only -verify %s
2// expected-no-diagnostics
3
4@interface Super @end
5
6@interface NSArray : Super @end
7@interface NSSet : Super @end
8
9@protocol MyProtocol
10- (void)myMethod;
11@end
12
13@protocol MyProtocol2 <MyProtocol>
14- (void)myMethod2;
15@end
16
17@interface NSArray() <MyProtocol2>
18@end
19
20@interface NSSet() <MyProtocol>
21@end
22
23int main (int argc, const char * argv[]) {
24    NSArray *array = (void*)0;
25    NSSet *set = (void*)0;
26    id <MyProtocol> instance = (argc) ? array : set;
27    instance = (void*)0;
28    return 0;
29}
30
31