[cfe-commits] r124074 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaExprObjC.cpp test/SemaObjC/undef-superclass-1.m
Ted Kremenek
kremenek at apple.com
Sun Jan 23 09:21:35 PST 2011
Author: kremenek
Date: Sun Jan 23 11:21:34 2011
New Revision: 124074
URL: http://llvm.org/viewvc/llvm-project?rev=124074&view=rev
Log:
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>
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/lib/Sema/SemaExprObjC.cpp
cfe/trunk/test/SemaObjC/undef-superclass-1.m
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=124074&r1=124073&r2=124074&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Sun Jan 23 11:21:34 2011
@@ -2522,8 +2522,8 @@
"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<
Modified: cfe/trunk/lib/Sema/SemaExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprObjC.cpp?rev=124074&r1=124073&r2=124074&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprObjC.cpp Sun Jan 23 11:21:34 2011
@@ -716,7 +716,8 @@
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();
}
Modified: cfe/trunk/test/SemaObjC/undef-superclass-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/undef-superclass-1.m?rev=124074&r1=124073&r2=124074&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/undef-superclass-1.m (original)
+++ cfe/trunk/test/SemaObjC/undef-superclass-1.m Sun Jan 23 11:21:34 2011
@@ -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
More information about the cfe-commits
mailing list