forked from OSchip/llvm-project
Tweak diagnostic:
error: no super class declared in @interface for 'XXX' to be: error: 'X' cannot use 'super' because it is a root class The latter explains what the user actually did wrong. Fixes: <rdar://problem/8904409> llvm-svn: 124074
This commit is contained in:
parent
3c4408ceb6
commit
499897b463
|
@ -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<
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue