summaryrefslogtreecommitdiff
path: root/test/SemaObjCXX/arc-unbridged-cast.mm
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjCXX/arc-unbridged-cast.mm')
-rw-r--r--test/SemaObjCXX/arc-unbridged-cast.mm9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/SemaObjCXX/arc-unbridged-cast.mm b/test/SemaObjCXX/arc-unbridged-cast.mm
index f7d239148704..3f7f76da5be2 100644
--- a/test/SemaObjCXX/arc-unbridged-cast.mm
+++ b/test/SemaObjCXX/arc-unbridged-cast.mm
@@ -108,3 +108,12 @@ void testTakerFunctions(id string) {
takeCFVariadicAudited(1, (CFStringRef) string);
takeCFConsumedAudited((CFStringRef) string); // expected-error {{cast of Objective-C pointer type 'id' to C pointer type 'CFStringRef'}} expected-note {{use __bridge to}} expected-note {{use CFBridgingRetain call to}}
}
+
+// rdar://12788838
+id obj;
+
+void rdar12788838() {
+ void *foo = reinterpret_cast<void *>(obj); // expected-error {{cast of Objective-C pointer type 'id' to C pointer type 'void *' requires a bridged cast}} \
+ // expected-note {{use __bridge with C-style cast to convert directly}} \
+ // expected-note {{use CFBridgingRetain call to make an ARC object available as a +1 'void *'}}
+}