From 14f260852f70f352db83470f40805e47b75db06a Mon Sep 17 00:00:00 2001 From: Alp Toker <alp@nuanti.com> Date: Tue, 3 Dec 2013 05:31:51 +0000 Subject: [PATCH] Test to ensure no old-style-cast warning is emitted for objc-arc __bridge casts git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196204 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/SemaObjCXX/old-style-cast.mm | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/SemaObjCXX/old-style-cast.mm diff --git a/test/SemaObjCXX/old-style-cast.mm b/test/SemaObjCXX/old-style-cast.mm new file mode 100644 index 00000000000..5dbac097054 --- /dev/null +++ b/test/SemaObjCXX/old-style-cast.mm @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -fobjc-arc -Wold-style-cast -verify %s +// expected-no-diagnostics + +// We don't currently have a way to write ARC/C++ bridge casts in terms of C++ +// casts, so ensure we don't emit an old-style-cast warning in these cases. + +id test(void *opaqueInput) { + id someObjCObject = (__bridge id)opaqueInput; + void *someCFObject = (__bridge_retained void *)someObjCObject; + return (__bridge_transfer id)someCFObject; +} -- GitLab