virtual DeclPtrTy ActOnParamDeclarator(Scope *S, Declarator &D) {
return DeclPtrTy();
}
+ virtual void ActOnObjCCatchParam(DeclPtrTy D) {
+ }
/// AddInitializerToDecl - This action is called immediately after
/// ActOnDeclarator (when an initializer is present). The code is factored
// Inform the actions module about the parameter declarator, so it
// gets added to the current scope.
FirstPart = Actions.ActOnParamDeclarator(CurScope, ParmDecl);
+ Actions.ActOnObjCCatchParam(FirstPart);
} else
ConsumeToken(); // consume '...'
bool &OverloadableAttrRequired);
void CheckMain(FunctionDecl *FD);
virtual DeclPtrTy ActOnParamDeclarator(Scope *S, Declarator &D);
+ virtual void ActOnObjCCatchParam(DeclPtrTy D);
virtual void ActOnParamDefaultArgument(DeclPtrTy param,
SourceLocation EqualLoc,
ExprArg defarg);
return DeclPtrTy::make(New);
}
+void Sema::ActOnObjCCatchParam(DeclPtrTy D) {
+ ParmVarDecl *Param = cast<ParmVarDecl>(D.getAs<Decl>());
+
+ if (FunctionDecl *Function = dyn_cast<FunctionDecl>(CurContext))
+ Param->setDeclContext(Function);
+ else if (CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(CurContext))
+ Param->setDeclContext(MD);
+ else if (BlockDecl *BD = dyn_cast<BlockDecl>(CurContext))
+ Param->setDeclContext(BD);
+ // FIXME. Other contexts?
+
+}
+
void Sema::ActOnFinishKNRParamDeclarations(Scope *S, Declarator &D,
SourceLocation LocAfterDecls) {
assert(D.getTypeObject(0).Kind == DeclaratorChunk::Function &&
--- /dev/null
+// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm -fblocks -o %t %s
+// rdar://7590273
+
+void EXIT(id e);
+
+@interface NSBlockOperation {
+}
++(id)blockOperationWithBlock:(void (^)(void))block ;
+@end
+
+void FUNC() {
+ [NSBlockOperation blockOperationWithBlock:^{
+ @try {
+
+ }
+ @catch (id exception) {
+ EXIT(exception);
+ }
+ }];
+
+}