diff --git a/clang/lib/Parse/ParseObjc.cpp b/clang/lib/Parse/ParseObjc.cpp index e837c765bff2..ef65204e8c36 100644 --- a/clang/lib/Parse/ParseObjc.cpp +++ b/clang/lib/Parse/ParseObjc.cpp @@ -1481,6 +1481,7 @@ Parser::OwningStmtResult Parser::ParseObjCTryStmt(SourceLocation atLoc) { // Inform the actions module about the parameter declarator, so it // gets added to the current scope. + // FIXME. Probably can build a VarDecl and avoid setting DeclContext. FirstPart = Actions.ActOnParamDeclarator(CurScope, ParmDecl); Actions.ActOnObjCCatchParam(FirstPart); } else diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 8c217f8e0d27..d203376f91ba 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -3936,15 +3936,7 @@ Sema::ActOnParamDeclarator(Scope *S, Declarator &D) { void Sema::ActOnObjCCatchParam(DeclPtrTy D) { ParmVarDecl *Param = cast(D.getAs()); - - if (FunctionDecl *Function = dyn_cast(CurContext)) - Param->setDeclContext(Function); - else if (CXXMethodDecl *MD = dyn_cast(CurContext)) - Param->setDeclContext(MD); - else if (BlockDecl *BD = dyn_cast(CurContext)) - Param->setDeclContext(BD); - // FIXME. Other contexts? - + Param->setDeclContext(CurContext); } void Sema::ActOnFinishKNRParamDeclarations(Scope *S, Declarator &D,