diff options
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index c604f6a4ee..8c217f8e0d 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -3934,6 +3934,19 @@ Sema::ActOnParamDeclarator(Scope *S, Declarator &D) { 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 && |