Patch to implemented objective-c's dynamic object pointer qualified with
the protocol list (id<P,...> types).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45121 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/SemaType.cpp b/Sema/SemaType.cpp
index 4eefabf..c89018a 100644
--- a/Sema/SemaType.cpp
+++ b/Sema/SemaType.cpp
@@ -113,6 +113,16 @@
reinterpret_cast<ObjcProtocolDecl**>(PPDecl),
DS.NumProtocolQualifiers());
}
+ else if (TypedefDecl *typeDecl = dyn_cast<TypedefDecl>(D)) {
+ if (Ctx.getObjcIdType() == Ctx.getTypedefType(typeDecl)
+ && DS.getProtocolQualifiers()) {
+ // id<protocol-list>
+ Action::DeclTy **PPDecl = &(*DS.getProtocolQualifiers())[0];
+ return Ctx.getObjcQualifiedIdType(typeDecl,
+ reinterpret_cast<ObjcProtocolDecl**>(PPDecl),
+ DS.NumProtocolQualifiers());
+ }
+ }
// TypeQuals handled by caller.
return Ctx.getTypedefType(cast<TypedefDecl>(D));
}