1 // RUN: %clang_cc1 -S -o - -triple i686-windows -verify -fblocks \
2 // RUN: -Wno-unused-comparison %s
4 #pragma clang diagnostic ignored "-Wunused-comparison"
6 #define nil ((id)nullptr)
14 @protocol OtherProtocol
17 __attribute__((objc_root_class))
18 @interface NSObject <NSObject, NSCopying>
21 __attribute__((objc_root_class))
26 void (^block)() = ^{};
28 id<NSObject, NSCopying> qualifiedId;
30 id<OtherProtocol> poorlyQualified1;
31 Test *objectOfWrongType;
41 // these are still not valid: blocks must be compared with id, NSObject*, or a protocol-qualified id
42 // conforming to NSCopying or NSObject.
44 block == poorlyQualified1; // expected-error {{invalid operands to binary expression ('void (^)()' and 'id<OtherProtocol>')}}
45 block == objectOfWrongType; // expected-error {{invalid operands to binary expression ('void (^)()' and 'Test *')}}
47 poorlyQualified1 == block; // expected-error {{invalid operands to binary expression ('id<OtherProtocol>' and 'void (^)()')}}
48 objectOfWrongType == block; // expected-error {{invalid operands to binary expression ('Test *' and 'void (^)()')}}