xref: /minix3/external/bsd/llvm/dist/clang/test/SemaObjCXX/old-style-cast.mm (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -fobjc-arc -Wold-style-cast -verify %s
2*0a6a1f1dSLionel Sambuc// expected-no-diagnostics
3*0a6a1f1dSLionel Sambuc
4*0a6a1f1dSLionel Sambuc// We don't currently have a way to write ARC/C++ bridge casts in terms of C++
5*0a6a1f1dSLionel Sambuc// casts, so ensure we don't emit an old-style-cast warning in these cases.
6*0a6a1f1dSLionel Sambuc
7*0a6a1f1dSLionel Sambucid test(void *opaqueInput) {
8*0a6a1f1dSLionel Sambuc  id someObjCObject = (__bridge id)opaqueInput;
9*0a6a1f1dSLionel Sambuc  void *someCFObject = (__bridge_retained void *)someObjCObject;
10*0a6a1f1dSLionel Sambuc  return (__bridge_transfer id)someCFObject;
11*0a6a1f1dSLionel Sambuc}
12