r196204 - Test to ensure no old-style-cast warning is emitted for objc-arc __bridge casts
Alp Toker
alp at nuanti.com
Mon Dec 2 21:31:51 PST 2013
Author: alp
Date: Mon Dec 2 23:31:51 2013
New Revision: 196204
URL: http://llvm.org/viewvc/llvm-project?rev=196204&view=rev
Log:
Test to ensure no old-style-cast warning is emitted for objc-arc __bridge casts
Added:
cfe/trunk/test/SemaObjCXX/old-style-cast.mm
Added: cfe/trunk/test/SemaObjCXX/old-style-cast.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/old-style-cast.mm?rev=196204&view=auto
==============================================================================
--- cfe/trunk/test/SemaObjCXX/old-style-cast.mm (added)
+++ cfe/trunk/test/SemaObjCXX/old-style-cast.mm Mon Dec 2 23:31:51 2013
@@ -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;
+}
More information about the cfe-commits
mailing list