]> granicus.if.org Git - clang/commitdiff
Fix more rewriting of protocol-quialified 'id' type.
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 3 Feb 2010 21:29:28 +0000 (21:29 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 3 Feb 2010 21:29:28 +0000 (21:29 +0000)
(Fixes radar 7607413).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95257 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/RewriteObjC.cpp
test/Rewriter/rewrite-protocol-qualified.mm

index 980c96ad17d9cf1391a65027c2006131ed14e653..9ec28bb6d4e0dd429c60f5704e4aa85ee09606d6 100644 (file)
@@ -1995,6 +1995,8 @@ static void scanToNextArgument(const char *&argRef) {
 }
 
 bool RewriteObjC::needToScanForQualifiers(QualType T) {
+  if (T->isObjCQualifiedIdType())
+    return true;
   if (const PointerType *PT = T->getAs<PointerType>()) {
     if (PT->getPointeeType()->isObjCQualifiedIdType())
       return true;
index e93ddbba2771619217c9afed1ab9e1c0443549be..e91c3db8616f8185030f92771c9bcb924b0b27c2 100644 (file)
 }
 @end
 
+// radar 7607413
+@protocol Proto1, Proto2;
+
+@protocol Proto
+@end
+
+unsigned char func(id<Proto1, Proto2> inProxy);
+
+id bar(id);
+
+void f() {
+        id a;
+        id b = bar((id <Proto>)a);
+}
+
 // CHECK-LP: NSConnection /*<NSPortDelegate>*/ *conn = 0; 
 
 // CHECK-LP: id /*<NSPortDelegate>*/ *idc = 0; 
+
+// CHECK-LP: func(id/*<Proto1, Proto2>*/ inProxy);
+
+// CHECK-LP: bar((id /*<Proto>*/)a);
+