summaryrefslogtreecommitdiffstats
path: root/clang/Sema/SemaExprObjC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/Sema/SemaExprObjC.cpp')
-rw-r--r--clang/Sema/SemaExprObjC.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/Sema/SemaExprObjC.cpp b/clang/Sema/SemaExprObjC.cpp
index 125a4c4f9d9..f4d16d9736c 100644
--- a/clang/Sema/SemaExprObjC.cpp
+++ b/clang/Sema/SemaExprObjC.cpp
@@ -258,8 +258,10 @@ Sema::ExprResult Sema::ActOnInstanceMessage(
SourceRange(lbrac, rbrac));
}
else {
- assert(ObjCInterfaceType::classof(receiverType.getTypePtr()) &&
- "bad receiver type");
+ if (!isa<ObjCInterfaceType>(receiverType.getTypePtr())) {
+ Diag(lbrac, diag::error_bad_receiver_type, receiverType.getAsString());
+ return true;
+ }
ClassDecl = static_cast<ObjCInterfaceType*>(
receiverType.getTypePtr())->getDecl();
// FIXME: consider using InstanceMethodPool, since it will be faster
OpenPOWER on IntegriCloud