From: Daniel Dunbar Date: Sat, 27 Sep 2008 22:21:14 +0000 (+0000) Subject: Bug fix, codegen @catch(id ...) acceptably. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=97f61d14c89c26b9ae8e8f1faa8e8fcc6ec00b77;p=clang Bug fix, codegen @catch(id ...) 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 f8d5c5c6d4..983f942c2d 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -1468,8 +1468,11 @@ void CGObjCMac::EmitTryStmt(CodeGen::CodeGenFunction &CGF, VD = cast(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; this should + // be rejected by Sema instead. + if ((PT && CGF.getContext().isObjCIdType(PT->getPointeeType())) || + VD->getType()->isObjCQualifiedIdType()) AllMatched = true; }