// 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
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?
-
+ Param->setDeclContext(CurContext);
}
void Sema::ActOnFinishKNRParamDeclarations(Scope *S, Declarator &D,