Bug fix, codegen @catch(id<X> ...) acceptably.
- This should be rejected by sema (IMHO) but that needs some
investigation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56756 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index f8d5c5c..983f942 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -1468,8 +1468,11 @@
VD = cast<VarDecl>(CatchParam->getDecl());
PT = VD->getType()->getAsPointerType();
- // catch(id e) always matches.
- if (PT && CGF.getContext().isObjCIdType(PT->getPointeeType()))
+ // catch(id e) always matches.
+ // FIXME: For the time being we also match id<X>; this should
+ // be rejected by Sema instead.
+ if ((PT && CGF.getContext().isObjCIdType(PT->getPointeeType())) ||
+ VD->getType()->isObjCQualifiedIdType())
AllMatched = true;
}