1 // RUN: %clang_cc1 -std=c++11 -triple x86_64-apple-darwin11 -fsyntax-only -fobjc-arc -verify %s
2 // RUN: %clang_cc1 -std=c++11 -triple x86_64-apple-darwin11 -fsyntax-only -verify -DNOARC %s
4 // expected-no-diagnostics
7 int testObjCComparisonRules(void *v, id x, id y) {
10 // expected-error@-2 {{implicit conversion of Objective-C pointer type 'id' to C pointer type 'void *' requires a bridged cast}}
11 // expected-note@-3 {{use __bridge to convert directly (no change in ownership)}}
12 // expected-note@-4 {{use __bridge_retained to make an ARC object available as a +1 'void *'}}
16 // expected-error@-2 {{implicit conversion of Objective-C pointer type 'id' to C pointer type 'void *' requires a bridged cast}}
17 // expected-note@-3 {{use __bridge to convert directly (no change in ownership)}}
18 // expected-note@-4 {{use __bridge_retained to make an ARC object available as a +1 'void *'}}
20 return v == (id)(void *)0; // OK
21 return v == nullptr; // OK
22 return v == (void *)0;