QualType FnRetType = CurBlock->ReturnType;
if (CurBlock->FunctionType->getAs<FunctionType>()->getNoReturnAttr()) {
- Diag(ReturnLoc, diag::err_noreturn_block_has_return_expr)
- << getCurFunctionOrMethodDecl()->getDeclName();
+ Diag(ReturnLoc, diag::err_noreturn_block_has_return_expr);
return StmtError();
}
if (FD->hasAttr<NoReturnAttr>() ||
FD->getType()->getAs<FunctionType>()->getNoReturnAttr())
Diag(ReturnLoc, diag::warn_noreturn_function_has_return_expr)
- << getCurFunctionOrMethodDecl()->getDeclName();
+ << FD->getDeclName();
} else if (ObjCMethodDecl *MD = getCurMethodDecl()) {
DeclaredRetType = MD->getResultType();
if (MD->hasRelatedResultType() && MD->getClassInterface()) {