aboutsummaryrefslogtreecommitdiff
path: root/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
commit95110968dcd6ba2baef2a23549cd5592f01eca59 (patch)
tree729db6ec9d5e9cdd6b8b0afa35684df96d29ffb0 /lib/Sema/SemaExprObjC.cpp
parent8730e130ab77ae5739e6339e1544b4ca9ab28450 (diff)
Make sure Sema::ActOnClassMessage() correctly diagnoses "super".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48924 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r--lib/Sema/SemaExprObjC.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index 4cf435c331..1a274e126e 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/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");