]> granicus.if.org Git - clang/commitdiff
Bug fix, codegen @catch(id<X> ...) acceptably.
authorDaniel Dunbar <daniel@zuster.org>
Sat, 27 Sep 2008 22:21:14 +0000 (22:21 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sat, 27 Sep 2008 22:21:14 +0000 (22:21 +0000)
 - 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

lib/CodeGen/CGObjCMac.cpp

index f8d5c5c6d45119f1d005bb683bbe3c5e6920d687..983f942c2de430b25b47a17e015282be2c68025e 100644 (file)
@@ -1468,8 +1468,11 @@ void CGObjCMac::EmitTryStmt(CodeGen::CodeGenFunction &CGF,
         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;
       }