diff options
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 4 | ||||
-rw-r--r-- | lib/Sema/SemaExprObjC.cpp | 3 | ||||
-rw-r--r-- | test/SemaObjC/undef-superclass-1.m | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 7d3c3c82c4..ce1359df22 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -2522,8 +2522,8 @@ def warn_inst_method_not_found : Warning< "method %objcinstance0 not found (return type defaults to 'id')">; def error_no_super_class_message : Error< "no @interface declaration found in class messaging of %0">; -def error_no_super_class : Error< - "no super class declared in @interface for %0">; +def error_root_class_cannot_use_super : Error< + "%0 cannot use 'super' because it is a root class">; def err_invalid_receiver_to_message : Error< "invalid receiver to message expression">; def err_invalid_receiver_to_message_super : Error< diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index ae18cc12c1..cc087a1a2d 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -716,7 +716,8 @@ ExprResult Sema::ActOnSuperMessage(Scope *S, ObjCInterfaceDecl *Super = Class->getSuperClass(); if (!Super) { // The current class does not have a superclass. - Diag(SuperLoc, diag::error_no_super_class) << Class->getIdentifier(); + Diag(SuperLoc, diag::error_root_class_cannot_use_super) + << Class->getIdentifier(); return ExprError(); } diff --git a/test/SemaObjC/undef-superclass-1.m b/test/SemaObjC/undef-superclass-1.m index 0c2594cc22..c941f82e43 100644 --- a/test/SemaObjC/undef-superclass-1.m +++ b/test/SemaObjC/undef-superclass-1.m @@ -22,7 +22,7 @@ @implementation SUPER - (void)dealloc { - [super dealloc]; // expected-error {{no super class declared in @interface for 'SUPER'}} + [super dealloc]; // expected-error {{'SUPER' cannot use 'super' because it is a root class}} } @end |