summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprObjC.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-03-28 21:37:05 +0000
committerSteve Naroff <snaroff@apple.com>2008-03-28 21:37:05 +0000
commit0de4199ca0c706b7b5826a9b41c4988bf210d03e (patch)
treeef3636f7cf0de002bd8fa22235298713ca58e258 /clang/lib/Sema/SemaExprObjC.cpp
parentb8654202ddf0c182f3a1a565a18add5488b2faba (diff)
downloadbcm5719-llvm-0de4199ca0c706b7b5826a9b41c4988bf210d03e.tar.gz
bcm5719-llvm-0de4199ca0c706b7b5826a9b41c4988bf210d03e.zip
Make sure Sema::ActOnClassMessage() correctly diagnoses "super".
llvm-svn: 48924
Diffstat (limited to 'clang/lib/Sema/SemaExprObjC.cpp')
-rw-r--r--clang/lib/Sema/SemaExprObjC.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp
index 4cf435c3315..1a274e126e0 100644
--- a/clang/lib/Sema/SemaExprObjC.cpp
+++ b/clang/lib/Sema/SemaExprObjC.cpp
@@ -146,7 +146,10 @@ Sema::ExprResult Sema::ActOnClassMessage(
ObjCInterfaceDecl* ClassDecl = 0;
if (!strcmp(receiverName->getName(), "super") && CurMethodDecl) {
ClassDecl = CurMethodDecl->getClassInterface()->getSuperClass();
- if (ClassDecl && CurMethodDecl->isInstance()) {
+ if (!ClassDecl)
+ return Diag(lbrac, diag::error_no_super_class,
+ CurMethodDecl->getClassInterface()->getName());
+ if (CurMethodDecl->isInstance()) {
// Synthesize a cast to the super class. This hack allows us to loosely
// represent super without creating a special expression node.
IdentifierInfo &II = Context.Idents.get("self");
OpenPOWER on IntegriCloud