summaryrefslogtreecommitdiffstats
path: root/clang/Sema/SemaExprObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2008-01-25 17:43:39 +0000
committerFariborz Jahanian <fjahanian@apple.com>2008-01-25 17:43:39 +0000
commitcc9c5452d178c4cd9a2a07b23208ed87b72f31de (patch)
tree896c5201ac9bc72006f9f3d6d4ebd0054c7a4e70 /clang/Sema/SemaExprObjC.cpp
parente5433a90ceed96f8139a9ef27a4118a99af42ece (diff)
downloadbcm5719-llvm-cc9c5452d178c4cd9a2a07b23208ed87b72f31de.tar.gz
bcm5719-llvm-cc9c5452d178c4cd9a2a07b23208ed87b72f31de.zip
Diagnose bad receiver type.
llvm-svn: 46358
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