Don't ICE (issue diagnostics) when receiver is a non-objc
type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62355 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index 548389d..8f4d677 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -239,8 +239,9 @@
if (TypedefDecl *OCTD = dyn_cast_or_null<TypedefDecl>(IDecl)) {
const ObjCInterfaceType *OCIT;
OCIT = OCTD->getUnderlyingType()->getAsObjCInterfaceType();
- if (OCIT)
- ClassDecl = OCIT->getDecl();
+ if (!OCIT)
+ return Diag(receiverLoc, diag::err_invalid_receiver_to_message);
+ ClassDecl = OCIT->getDecl();
}
}
assert(ClassDecl && "missing interface declaration");